From: Dan Carpenter Date: Tue, 11 Jan 2011 01:42:10 +0000 (-0800) Subject: IB/mthca: Handle -ENOMEM in forward_trap() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d0444f1527f22d193c209d4fdad0dbabbf2be2ee;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git IB/mthca: Handle -ENOMEM in forward_trap() ib_create_send_mad() can return ERR_PTR(-ENOMEM) here. Signed-off-by: Dan Carpenter Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c index 5648659ff0b0..03a59534f59e 100644 --- a/drivers/infiniband/hw/mthca/mthca_mad.c +++ b/drivers/infiniband/hw/mthca/mthca_mad.c @@ -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