Commit a87d8a45 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

iscsi: replace incorrect off_t with ptrdiff_t



This code calculates the difference between two pointers and then stores
it in an off_t, which is intended for file offsets.

In this particular case, the offset will never be large enough to
overflow off_t, but use the correct ptrdiff_t type anyway.

Change-Id: I6b159bf0286a7f5962d08b9894538f4d99c8647b
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent d5dffc05
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@
#include <rte_version.h>

#include <inttypes.h>
#include <stddef.h>
#include <unistd.h>

#include "iscsi/iscsi.h"
@@ -319,7 +320,7 @@ spdk_mobj_ctor(struct rte_mempool *mp, __attribute__((unused)) void *arg,
{
	struct spdk_mobj *m = _m;
	uint64_t *phys_addr;
	off_t off;
	ptrdiff_t off;

	m->mp = mp;
	m->buf = (uint8_t *)m + sizeof(struct spdk_mobj);