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/[email protected] Signed-off-by: YueHaibing <[email protected]> Acked-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 475f23b commit 3a9b3d4

File tree

1 file changed

+3
-1
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+3
-1
lines changed

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)