Skip to content

Commit

Permalink
scsi: libfc: remove unnecessary condition check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chengguang Xu authored and Martin K. Petersen committed Aug 30, 2018
1 parent 26c724a commit b6876a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/libfc/fc_fcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit b6876a8

Please sign in to comment.