Skip to content

Commit

Permalink
IB/mthca: Handle -ENOMEM in forward_trap()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Roland Dreier committed Jan 11, 2011
1 parent 3c0eee3 commit d0444f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/infiniband/hw/mthca/mthca_mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0444f1

Please sign in to comment.