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

Commit d485eb83 authored by Moore, Eric Dean 's avatar Moore, Eric Dean Committed by James Bottomley
Browse files

[SCSI] fusion-kfree-cleanup



This patch is originally From: Jesper Juhl <juhl-lkml@dif.dk>

This patch gets rid of redundant NULL checks prior to calling kfree() in
drivers/message/* There are also a few small whitespace changes in there.

Signed-off-by: default avatarEric Moore <Eric.Moore@lsil.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 3fadc59d
Loading
Loading
Loading
Loading
+8 −17
Original line number Diff line number Diff line
@@ -1837,15 +1837,10 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
		ioc->alloc_total -= sz;
	}

	if (ioc->spi_data.nvram != NULL) {
	kfree(ioc->spi_data.nvram);
		ioc->spi_data.nvram = NULL;
	}

	if (ioc->spi_data.pIocPg3 != NULL) {
	kfree(ioc->spi_data.pIocPg3);
	ioc->spi_data.nvram = NULL;
	ioc->spi_data.pIocPg3 = NULL;
	}

	if (ioc->spi_data.pIocPg4 != NULL) {
		sz = ioc->spi_data.IocPg4Sz;
@@ -1862,11 +1857,9 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
		ioc->ReqToChain = NULL;
	}

	if (ioc->ChainToChain != NULL) {
	kfree(ioc->ChainToChain);
	ioc->ChainToChain = NULL;
}
}

/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
@@ -4403,10 +4396,8 @@ mpt_read_ioc_pg_3(MPT_ADAPTER *ioc)

	/* Free the old page
	 */
	if (ioc->spi_data.pIocPg3) {
	kfree(ioc->spi_data.pIocPg3);
	ioc->spi_data.pIocPg3 = NULL;
	}

	/* There is at least one physical disk.
	 * Read and save IOC Page 3
+6 −9
Original line number Diff line number Diff line
@@ -998,19 +998,16 @@ mptscsih_remove(struct pci_dev *pdev)
		hd->ScsiLookup = NULL;
	}

	if (hd->Targets != NULL) {
	/*
	 * Free pointer array.
	 */
	kfree(hd->Targets);
	hd->Targets = NULL;
	}

	dprintk((MYIOC_s_INFO_FMT
	    "Free'd ScsiLookup (%d) memory\n",
	    hd->ioc->name, sz1));

	if (hd->info_kbuf != NULL)
	kfree(hd->info_kbuf);

	/* NULL the Scsi_Host pointer
+11 −11

File changed.

Contains only whitespace changes.

+2 −2

File changed.

Contains only whitespace changes.