Skip to content

Commit f3136c4

Browse files
rleonjgunthorpe
authored andcommitted
RDMA/mlx4: Don't continue event handler after memory allocation failure
The failure to allocate memory during MLX4_DEV_EVENT_PORT_MGMT_CHANGE event handler will cause skip the assignment logic, but ib_dispatch_event() will be called anyway. Fix it by calling to return instead of break after memory allocation failure. Fixes: 00f5ce9 ("mlx4: Use port management change event instead of smp_snoop") Link: https://lore.kernel.org/r/12a0e83f18cfad4b5f62654f141e240d04915e10.1643622264.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent b43a76f commit f3136c4

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/hw/mlx4

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/mlx4/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3237,7 +3237,7 @@ static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr,
32373237
case MLX4_DEV_EVENT_PORT_MGMT_CHANGE:
32383238
ew = kmalloc(sizeof *ew, GFP_ATOMIC);
32393239
if (!ew)
3240-
break;
3240+
return;
32413241

32423242
INIT_WORK(&ew->work, handle_port_mgmt_change_event);
32433243
memcpy(&ew->ib_eqe, eqe, sizeof *eqe);

0 commit comments

Comments
 (0)