aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed/drivers/infiniband/core/uverbs.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ofed/drivers/infiniband/core/uverbs.h')
-rw-r--r--sys/ofed/drivers/infiniband/core/uverbs.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ofed/drivers/infiniband/core/uverbs.h b/sys/ofed/drivers/infiniband/core/uverbs.h
index 6c8d9632b0dc..0db0d47cc691 100644
--- a/sys/ofed/drivers/infiniband/core/uverbs.h
+++ b/sys/ofed/drivers/infiniband/core/uverbs.h
@@ -64,8 +64,10 @@
#define INIT_UDATA_BUF_OR_NULL(udata, ibuf, obuf, ilen, olen) \
do { \
- (udata)->inbuf = (ilen) ? (const void __user *) (ibuf) : NULL; \
- (udata)->outbuf = (olen) ? (void __user *) (obuf) : NULL; \
+ (udata)->inbuf = ((ilen) != 0) ? \
+ (const void __user *) (ibuf) : NULL; \
+ (udata)->outbuf = ((olen) != 0) ? \
+ (void __user *) (obuf) : NULL; \
(udata)->inlen = (ilen); \
(udata)->outlen = (olen); \
} while (0)