scsi: libfc: remove unnecessary condition check
authorChengguang Xu <cgxu519@gmx.com>
Mon, 27 Aug 2018 23:50:08 +0000 (07:50 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 30 Aug 2018 11:36:48 +0000 (07:36 -0400)
kmem_cache_destroy() can handle NULL pointer correctly, so there is no
need to check NULL pointer before calling kmem_cache_destroy()

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_fcp.c

index 4fae253..563247d 100644 (file)
@@ -2295,8 +2295,7 @@ int fc_setup_fcp(void)
 
 void fc_destroy_fcp(void)
 {
-       if (scsi_pkt_cachep)
-               kmem_cache_destroy(scsi_pkt_cachep);
+       kmem_cache_destroy(scsi_pkt_cachep);
 }
 
 /**