IB/hfi1: Return an error on memory allocation failure
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Thu, 4 May 2017 12:14:28 +0000 (05:14 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 4 May 2017 23:31:46 +0000 (19:31 -0400)
If the eager buffer allocation fails, it is necessary to return
an error code.

Cc: stable@vger.kernel.org
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/init.c

index c573f06..b2db776 100644 (file)
@@ -1778,6 +1778,7 @@ int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd)
                            !HFI1_CAP_KGET_MASK(rcd->flags, MULTI_PKT_EGR)) {
                                dd_dev_err(dd, "ctxt%u: Failed to allocate eager buffers\n",
                                           rcd->ctxt);
+                               ret = -ENOMEM;
                                goto bail_rcvegrbuf_phys;
                        }