[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1450104189-2653-2-git-send-email-hofrat@osadl.org>
Date: Mon, 14 Dec 2015 15:43:08 +0100
From: Nicholas Mc Guire <hofrat@...dl.org>
To: Mike Marciniszyn <infinipath@...el.com>
Cc: Doug Ledford <dledford@...hat.com>,
Sean Hefty <sean.hefty@...el.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-rdma@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, Nicholas Mc Guire <hofrat@...dl.org>
Subject: [PATCH 2/3] staging/rdma/hfi1: check return value of kcalloc
Add a null check after the kcalloc call as proposed by
Mike Marciniszyn <mike.marciniszyn@...el.com>.
Signed-off-by: Nicholas Mc Guire <hofrat@...dl.org>
---
Patch was compile tested with: x86_64_defconfig
CONFIG_INFINIBAND=m, CONFIG_STAGING=y, CONFIG_STAGING_RDMA=m
Patch is against linux-next (localversion-next is -next-20151214)
drivers/staging/rdma/hfi1/chip.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index 31eec8a..52d2bd7 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -10129,6 +10129,9 @@ static void init_qos(struct hfi1_devdata *dd, u32 first_ctxt)
if (num_vls * qpns_per_vl > dd->chip_rcv_contexts)
goto bail;
rsmmap = kcalloc(NUM_MAP_REGS, sizeof(u64), GFP_KERNEL);
+ if (!rsmmap)
+ goto bail;
+
/* init the local copy of the table */
for (i = 0, ctxt = first_ctxt; i < num_vls; i++) {
unsigned tctxt;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists