From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT: drivers/infiniband/core/uverbs_ioctl.c

Change-Id: I17bd1a2dfb074f55f03bdf8307b9b7429a5e8990
---
 drivers/infiniband/core/uverbs_ioctl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/infiniband/core/uverbs_ioctl.c
+++ b/drivers/infiniband/core/uverbs_ioctl.c
@@ -131,7 +131,11 @@ __malloc void *_uverbs_alloc(struct uver
 	res = (void *)pbundle->internal_buffer + pbundle->internal_used;
 	pbundle->internal_used =
 		ALIGN(new_used, sizeof(*pbundle->internal_buffer));
+#ifdef HAVE_WANT_INIT_ON_ALLOC
 	if (want_init_on_alloc(flags))
+#else
+	if (flags & __GFP_ZERO)    
+#endif 
 		memset(res, 0, size);
 	return res;
 }
@@ -569,7 +573,6 @@ static int ib_uverbs_cmd_verbs(struct ib
 
 	if (unlikely(hdr->driver_id != uapi->driver_id))
 		return -EINVAL;
-
 	slot = radix_tree_iter_lookup(
 		&uapi->radix, &attrs_iter,
 		uapi_key_obj(hdr->object_id) |
