Skip to content

Commit 3a9b3d4

Browse files
YueHaibingjgunthorpe
authored andcommitted
IB/mlx5: Add missing error code
Set err to -ENOMEM if kzalloc fails instead of 0. Fixes: 7597385 ("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>
1 parent 475f23b commit 3a9b3d4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • drivers/infiniband/hw/mlx5

drivers/infiniband/hw/mlx5/devx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2073,8 +2073,10 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)(
20732073

20742074
num_alloc_xa_entries++;
20752075
event_sub = kzalloc(sizeof(*event_sub), GFP_KERNEL);
2076-
if (!event_sub)
2076+
if (!event_sub) {
2077+
err = -ENOMEM;
20772078
goto err;
2079+
}
20782080

20792081
list_add_tail(&event_sub->event_list, &sub_list);
20802082
uverbs_uobject_get(&ev_file->uobj);

0 commit comments

Comments
 (0)