From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Elfring Date: Thu, 09 Jul 2020 17:16:01 +0000 Subject: Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Xianting Tian , linux-scsi@vger.kernel.org, virtualization@lists.linux-foundation.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, "James E. J. Bottomley" , Jason Wang , Paolo Bonzini , "Martin K. Petersen" , "Michael S. Tsirkin" , Stefan Hajnoczi > kmem_cache_destroy and mempool_destroy can correctly handle > null pointer parameter, so there is no need to check if the > parameter is null before calling kmem_cache_destroy and > mempool_destroy. Can another imperative wording be preferred for the change description? … > +++ b/drivers/scsi/virtio_scsi.c > @@ -1003,14 +1003,10 @@ static int __init init(void) > return 0; > > error: Can such a label be questionable? … > + mempool_destroy(virtscsi_cmd_pool); > + virtscsi_cmd_pool = NULL; > + kmem_cache_destroy(virtscsi_cmd_cache); > + virtscsi_cmd_cache = NULL; > return ret; > } How do you think about to add a jump target so that the execution of a few statements can be avoided according to a previous null pointer check? Regards, Markus