aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2017-04-18 12:03:39 +0300
committerDoug Ledford <dledford@redhat.com>2017-04-20 11:44:07 -0400
commitd9edfc5a4f81165e64d4ad6e423a8554c88dd0de (patch)
tree2c5ae8c0cdda14dda6c34ddc3f2a92e89040d359 /drivers
parentIB/core: Don't pass the lock state to _rdma_remove_commit_uobject (diff)
downloadlinux-dev-d9edfc5a4f81165e64d4ad6e423a8554c88dd0de.tar.xz
linux-dev-d9edfc5a4f81165e64d4ad6e423a8554c88dd0de.zip
IB/core: Nullify ib_uobject during allocation
Currently, we initialize all fields of ib_uobject straight after allocation. Therefore, a kmalloc was sufficient. Since ib_uobject could be embedded in a type specific structure, we nullify it to spare programmer errors. Fixes: 3832125624b7 ('IB/core: Add support for idr types') Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/rdma_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c
index 699a6595e7cf..41c31a2bf093 100644
--- a/drivers/infiniband/core/rdma_core.c
+++ b/drivers/infiniband/core/rdma_core.c
@@ -84,7 +84,7 @@ static int uverbs_try_lock_object(struct ib_uobject *uobj, bool exclusive)
static struct ib_uobject *alloc_uobj(struct ib_ucontext *context,
const struct uverbs_obj_type *type)
{
- struct ib_uobject *uobj = kmalloc(type->obj_size, GFP_KERNEL);
+ struct ib_uobject *uobj = kzalloc(type->obj_size, GFP_KERNEL);
if (!uobj)
return ERR_PTR(-ENOMEM);