IB: handle -ENOMEM in forward_trap()
Subsystems (3)
PATCH 1/1 IB: handle -ENOMEM in forward_trap()
ib_create_send_mad() can return ERR_PTR(-ENOMEM) here.
Signed-off-by Dan Carpenter <[email protected]>
drivers/infiniband/hw/mlx4/mad.c +3 -0
@@ -211,6 +211,9 @@ static void forward_trap(struct mlx4_ib_dev *dev, u8 port_num, struct ib_mad *maif (agent) { send_buf =ib_create_send_mad (agent, qpn,0 ,0 ,IB_MGMT_MAD_HDR ,IB_MGMT_MAD_DATA ,GFP_ATOMIC ); + +if (IS_ERR (send_buf)) +return ;/* * We rely here on the fact that MLX QPs don't use the * address handle after the send is posted (this is
drivers/infiniband/hw/mthca/mthca_mad.c +2 -0
@@ -171,6 +171,8 @@ static void forward_trap(struct mthca_dev *dev,if (agent) { send_buf =ib_create_send_mad (agent, qpn,0 ,0 ,IB_MGMT_MAD_HDR ,IB_MGMT_MAD_DATA ,GFP_ATOMIC ); +if (IS_ERR (send_buf)) +return ;/* * We rely here on the fact that MLX QPs don't use the * address handle after the send is posted (this is
Roland Dreier
Appliedthanks, applied.