public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]scsi_debug:c: fix call vfree()
@ 2009-06-07  5:30 Figo.zhang
  0 siblings, 0 replies; only message in thread
From: Figo.zhang @ 2009-06-07  5:30 UTC (permalink / raw)
  To: James Bottomley; +Cc: Douglas Gilbert, linux-scsi

vfree() does it's own 'NULL' check,so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
---   
drivers/scsi/scsi_debug.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 213123b..c24af62 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -2976,8 +2976,7 @@ bus_unreg:
 dev_unreg:
 	device_unregister(&pseudo_primary);
 free_vm:
-	if (dif_storep)
-		vfree(dif_storep);
+	vfree(dif_storep);
 	vfree(fake_storep);
 
 	return ret;
@@ -2995,8 +2994,7 @@ static void __exit scsi_debug_exit(void)
 	bus_unregister(&pseudo_lld_bus);
 	device_unregister(&pseudo_primary);
 
-	if (dif_storep)
-		vfree(dif_storep);
+	vfree(dif_storep);
 
 	vfree(fake_storep);
 }



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-07  5:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-07  5:30 [PATCH]scsi_debug:c: fix call vfree() Figo.zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox