2004-09-03 20:50:39

by Dave Jones

[permalink] [raw]
Subject: Remove bogus memset from cpqfc driver.

Not that this driver compiles, but coverity picked up this nonsense.
If the pci_alloc_consistent fails, we go boom.
Amusingly, after the ==NULL check, is an identical memset.

Signed-off-by: Dave Jones <[email protected]>

--- linux-2.6.8/drivers/scsi/cpqfcTScontrol.c~ 2004-09-03 21:44:41.742800408 +0100
+++ linux-2.6.8/drivers/scsi/cpqfcTScontrol.c 2004-09-03 21:45:37.163375200 +0100
@@ -116,7 +116,6 @@
cpqfcHBAdata->fcLQ = pci_alloc_consistent(cpqfcHBAdata->PciDev,
sizeof( FC_LINK_QUE), &cpqfcHBAdata->fcLQ_dma_handle);
/* printk("@ %p (%u elements)\n", cpqfcHBAdata->fcLQ, FC_LINKQ_DEPTH); */
- memset( cpqfcHBAdata->fcLQ, 0, sizeof( FC_LINK_QUE));

if( cpqfcHBAdata->fcLQ == NULL ) // fatal error!!
{