summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorTomas Henzl <thenzl@redhat.com>2012-02-13 18:29:58 +0100
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 09:37:10 -0600
commitc834b1c4ec8ccc9c2d814bd78264b509708fe6dd (patch)
treec79fad5e2479be7ab47e3956ce699363900e15f8 /drivers/scsi
parentcf3059a12936f8e92876e56b50bcdb092be70645 (diff)
downloadop-kernel-dev-c834b1c4ec8ccc9c2d814bd78264b509708fe6dd.zip
op-kernel-dev-c834b1c4ec8ccc9c2d814bd78264b509708fe6dd.tar.gz
[SCSI] mpt2sas: add missing allocation check
The __get_free_pages can fail, so the return value should be checked. Spotted thanks to Stanislaw. Signed-off-by: Tomas Henzl <thenzl@redhat.com> Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index a78036f..82fa6ce 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -2575,6 +2575,11 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
ioc->chain_lookup = (struct chain_tracker *)__get_free_pages(
GFP_KERNEL, ioc->chain_pages);
+ if (!ioc->chain_lookup) {
+ printk(MPT2SAS_ERR_FMT "chain_lookup: get_free_pages failed, "
+ "sz(%d)\n", ioc->name, (int)sz);
+ goto out;
+ }
ioc->chain_dma_pool = pci_pool_create("chain pool", ioc->pdev,
ioc->request_sz, 16, 0);
if (!ioc->chain_dma_pool) {
OpenPOWER on IntegriCloud