lkml.org 
[lkml]   [2020]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks
From
Date
> 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

\
 
 \ /
  Last update: 2020-07-09 19:17    [W:1.202 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site