Skip to content

Commit d0444f1

Browse files
error27Roland Dreier
authored andcommitted
IB/mthca: Handle -ENOMEM in forward_trap()
ib_create_send_mad() can return ERR_PTR(-ENOMEM) here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
1 parent 3c0eee3 commit d0444f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/infiniband/hw/mthca/mthca_mad.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ static void forward_trap(struct mthca_dev *dev,
171171
if (agent) {
172172
send_buf = ib_create_send_mad(agent, qpn, 0, 0, IB_MGMT_MAD_HDR,
173173
IB_MGMT_MAD_DATA, GFP_ATOMIC);
174+
if (IS_ERR(send_buf))
175+
return;
174176
/*
175177
* We rely here on the fact that MLX QPs don't use the
176178
* address handle after the send is posted (this is

0 commit comments

Comments
 (0)