All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] IB/mlx5: Add missing error code
@ 2021-02-22  8:25 YueHaibing
  2021-02-22 12:12   ` kernel test robot
  2021-02-22 12:23 ` [PATCH v2 " YueHaibing
  0 siblings, 2 replies; 7+ messages in thread
From: YueHaibing @ 2021-02-22  8:25 UTC (permalink / raw)
  To: leon, dledford, jgg, yishaih; +Cc: linux-rdma, linux-kernel, YueHaibing

Set err to -ENOMEM if kzalloc fails instead of 0.

Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/mlx5/devx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c
index ebc2a4355fa5..3c8e6a25465d 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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-01 18:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-22  8:25 [PATCH -next] IB/mlx5: Add missing error code YueHaibing
2021-02-22 12:12 ` kernel test robot
2021-02-22 12:12   ` kernel test robot
2021-02-22 12:23 ` [PATCH v2 " YueHaibing
2021-02-22 13:23   ` Leon Romanovsky
2021-02-22 14:21     ` YueHaibing
2021-03-01 18:49   ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.