diff options
author | Tomas Henzl <thenzl@redhat.com> | 2012-02-13 12:29:58 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 10:37:10 -0500 |
commit | c834b1c4ec8ccc9c2d814bd78264b509708fe6dd (patch) | |
tree | c79fad5e2479be7ab47e3956ce699363900e15f8 | |
parent | cf3059a12936f8e92876e56b50bcdb092be70645 (diff) |
[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>
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index a78036f5e1a6..82fa6ce481f0 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) | |||
2575 | 2575 | ||
2576 | ioc->chain_lookup = (struct chain_tracker *)__get_free_pages( | 2576 | ioc->chain_lookup = (struct chain_tracker *)__get_free_pages( |
2577 | GFP_KERNEL, ioc->chain_pages); | 2577 | GFP_KERNEL, ioc->chain_pages); |
2578 | if (!ioc->chain_lookup) { | ||
2579 | printk(MPT2SAS_ERR_FMT "chain_lookup: get_free_pages failed, " | ||
2580 | "sz(%d)\n", ioc->name, (int)sz); | ||
2581 | goto out; | ||
2582 | } | ||
2578 | ioc->chain_dma_pool = pci_pool_create("chain pool", ioc->pdev, | 2583 | ioc->chain_dma_pool = pci_pool_create("chain pool", ioc->pdev, |
2579 | ioc->request_sz, 16, 0); | 2584 | ioc->request_sz, 16, 0); |
2580 | if (!ioc->chain_dma_pool) { | 2585 | if (!ioc->chain_dma_pool) { |