summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-01-11 02:42:06 +0100
committerRoland Dreier <rolandd@cisco.com>2011-01-11 02:42:06 +0100
commit1397490938aa0aca39001c3fd5a9fc9387110d86 (patch)
tree8f4baeec7d2349f49face4ba9a90903afe4dca3f /drivers/infiniband
parentmlx4_core: Avoid vunmap() of invalid pointer if allocation fails (diff)
downloadlinux-1397490938aa0aca39001c3fd5a9fc9387110d86.tar.xz
linux-1397490938aa0aca39001c3fd5a9fc9387110d86.zip
IB/mlx4: 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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx4/mad.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index c9a8dd63b9e2..57ffa50f509e 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -211,6 +211,8 @@ static void forward_trap(struct mlx4_ib_dev *dev, u8 port_num, struct ib_mad *ma
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