summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/hfi1/verbs.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2021-12-10 23:57:09 +0300
committerJonathan Corbet <corbet@lwn.net>2021-12-10 23:57:09 +0300
commita7fb920b158da0a154da609a4c27ff693404ec90 (patch)
tree0637688614d7889aef9dd76870b9605d3f563247 /drivers/infiniband/hw/hfi1/verbs.c
parentce881fc06dc87e73928ced4c37b6ac6b32ef5fb6 (diff)
parent0fcfb00b28c0b7884635dacf38e46d60bf3d4eb1 (diff)
downloadlinux-a7fb920b158da0a154da609a4c27ff693404ec90.tar.xz
Merge tag 'v5.16-rc4' into docs-next
I have a couple of fixes for warnings introduced after -rc1; catch up to -rc4 so that the fixes have something to fix.
Diffstat (limited to 'drivers/infiniband/hw/hfi1/verbs.c')
-rw-r--r--drivers/infiniband/hw/hfi1/verbs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index ed9fa0d84e9e..dc9211f3a009 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -1628,8 +1628,7 @@ static int init_cntr_names(const char *names_in, const size_t names_len,
n++;
names_out =
- kmalloc((n + num_extra_names) * sizeof(struct rdma_stat_desc) +
- names_len,
+ kzalloc((n + num_extra_names) * sizeof(*q) + names_len,
GFP_KERNEL);
if (!names_out) {
*num_cntrs = 0;
@@ -1637,7 +1636,7 @@ static int init_cntr_names(const char *names_in, const size_t names_len,
return -ENOMEM;
}
- p = names_out + (n + num_extra_names) * sizeof(struct rdma_stat_desc);
+ p = names_out + (n + num_extra_names) * sizeof(*q);
memcpy(p, names_in, names_len);
q = (struct rdma_stat_desc *)names_out;