summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2021-02-22 13:23:43 +0100
committerJason Gunthorpe <jgg@nvidia.com>2021-03-01 19:49:09 +0100
commit3a9b3d4536e0c25bd3906a28c1f584177e49dd0f (patch)
treed2c983d43c8f266ae7f1892b13f5c07c1dfae1bd /drivers/infiniband
parentRDMA/rxe: Fix missing kconfig dependency on CRYPTO (diff)
downloadlinux-3a9b3d4536e0c25bd3906a28c1f584177e49dd0f.tar.xz
linux-3a9b3d4536e0c25bd3906a28c1f584177e49dd0f.zip
IB/mlx5: Add missing error code
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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx5/devx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c
index ebc2a4355fa5..de3c2fc6f361 100644
--- 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);