Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c834b1c4 authored by Tomas Henzl's avatar Tomas Henzl Committed by James Bottomley
Browse files

[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: default avatarTomas Henzl <thenzl@redhat.com>
Acked-by: default avatar"Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent cf3059a1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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) {