Skip to content

Commit 86b3b62

Browse files
YueHaibinggregkh
authored andcommitted
IB/mlx5: Add missing error code
[ Upstream commit 3a9b3d4 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 809ef26 commit 86b3b62

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
@@ -2022,8 +2022,10 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)(
20222022

20232023
num_alloc_xa_entries++;
20242024
event_sub = kzalloc(sizeof(*event_sub), GFP_KERNEL);
2025-
if (!event_sub)
2025+
if (!event_sub) {
2026+
err = -ENOMEM;
20262027
goto err;
2028+
}
20272029

20282030
list_add_tail(&event_sub->event_list, &sub_list);
20292031
if (use_eventfd) {

0 commit comments

Comments
 (0)