diff options
author | Parav Pandit <parav@mellanox.com> | 2018-06-13 10:22:02 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-06-18 11:11:26 -0600 |
commit | fb51eecaa523c909cdc6240d3e9b8bfc74e7a888 (patch) | |
tree | 032ef944c2a626ca878c9d91e29194de1626f382 /drivers | |
parent | 0c271c433ca2f481ccf5e9a5645a2ec071188c19 (diff) | |
download | linux-stable-fb51eecaa523c909cdc6240d3e9b8bfc74e7a888.tar.gz linux-stable-fb51eecaa523c909cdc6240d3e9b8bfc74e7a888.tar.bz2 linux-stable-fb51eecaa523c909cdc6240d3e9b8bfc74e7a888.zip |
IB: Ensure that all rdma_ah_attr's are zero initialized
Since we are adding some new fields to this structure it is safest if all
users reliably initialize the struct to zero.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/core/uverbs_cmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 72803f836b2d..5733d0fb0673 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -1968,7 +1968,7 @@ static int modify_qp(struct ib_uverbs_file *file, struct ib_qp *qp; int ret; - attr = kmalloc(sizeof *attr, GFP_KERNEL); + attr = kzalloc(sizeof(*attr), GFP_KERNEL); if (!attr) return -ENOMEM; @@ -2552,7 +2552,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file, struct ib_uobject *uobj; struct ib_pd *pd; struct ib_ah *ah; - struct rdma_ah_attr attr; + struct rdma_ah_attr attr = {}; int ret; struct ib_udata udata; |