[PATCH] kfree cleanup: drivers/scsi
This is the drivers/scsi/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in drivers/scsi/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Acked-by: Kai Makisara <kai.makisara@kolumbus.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
089b1dbbde
commit
c9475cb0c3
@@ -543,10 +543,8 @@ static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id, struct pt
|
||||
return;
|
||||
}
|
||||
my_done = SCtmp->scsi_done;
|
||||
if (SCtmp->host_scribble) {
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
}
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
/* Fetch the sense data, and tuck it away, in the required slot. The
|
||||
Adaptec automatically fetches it, and there is no guarantee that
|
||||
we will still have it in the cdb when we come back */
|
||||
@@ -1432,10 +1430,8 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt)
|
||||
HOSTDATA(SCpnt->host)->SCint[i]->target == SCpnt->target) {
|
||||
Scsi_Cmnd *SCtmp;
|
||||
SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
|
||||
if (SCtmp->host_scribble) {
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
}
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
HOSTDATA(SCpnt->host)->SCint[i] = NULL;
|
||||
HOSTDATA(SCpnt->host)->mb[i].status = 0;
|
||||
}
|
||||
@@ -1495,10 +1491,8 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt)
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
if (SCtmp->host_scribble) {
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
}
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
HOSTDATA(SCpnt->device->host)->SCint[i] = NULL;
|
||||
HOSTDATA(SCpnt->device->host)->mb[i].status = 0;
|
||||
}
|
||||
@@ -1565,10 +1559,8 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt)
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
if (SCtmp->host_scribble) {
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
}
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
HOSTDATA(SCpnt->device->host)->SCint[i] = NULL;
|
||||
HOSTDATA(SCpnt->device->host)->mb[i].status = 0;
|
||||
}
|
||||
@@ -1711,10 +1703,8 @@ static int aha1542_old_reset(Scsi_Cmnd * SCpnt, unsigned int reset_flags)
|
||||
Scsi_Cmnd *SCtmp;
|
||||
SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
|
||||
SCtmp->result = DID_RESET << 16;
|
||||
if (SCtmp->host_scribble) {
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
}
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
printk(KERN_WARNING "Sending DID_RESET for target %d\n", SCpnt->target);
|
||||
SCtmp->scsi_done(SCpnt);
|
||||
|
||||
@@ -1757,10 +1747,8 @@ fail:
|
||||
Scsi_Cmnd *SCtmp;
|
||||
SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
|
||||
SCtmp->result = DID_RESET << 16;
|
||||
if (SCtmp->host_scribble) {
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
}
|
||||
kfree(SCtmp->host_scribble);
|
||||
SCtmp->host_scribble = NULL;
|
||||
printk(KERN_WARNING "Sending DID_RESET for target %d\n", SCpnt->target);
|
||||
SCtmp->scsi_done(SCpnt);
|
||||
|
||||
|
Reference in New Issue
Block a user