projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
475f23b
)
IB/mlx5: Add missing error code
author
YueHaibing
<yuehaibing@huawei.com>
Mon, 22 Feb 2021 12:23:43 +0000
(20:23 +0800)
committer
Jason Gunthorpe
<jgg@nvidia.com>
Mon, 1 Mar 2021 18:49:09 +0000
(14:49 -0400)
Set err to -ENOMEM if kzalloc fails instead of 0.
Fixes:
759738537142
("IB/mlx5: Enable subscription for device events over DEVX")
Link:
https://lore.kernel.org/r/20210222122343.19720-1-yuehaibing@huawei.com
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/devx.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/mlx5/devx.c
b/drivers/infiniband/hw/mlx5/devx.c
index
ebc2a43
..
de3c2fc
100644
(file)
--- a/
drivers/infiniband/hw/mlx5/devx.c
+++ b/
drivers/infiniband/hw/mlx5/devx.c
@@
-2073,8
+2073,10
@@
static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)(
num_alloc_xa_entries++;
event_sub = kzalloc(sizeof(*event_sub), GFP_KERNEL);
- if (!event_sub)
+ if (!event_sub) {
+ err = -ENOMEM;
goto err;
+ }
list_add_tail(&event_sub->event_list, &sub_list);
uverbs_uobject_get(&ev_file->uobj);