Re: [PATCH] s390/dasd: remove unnecessary condition check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28.08.2018 01:51, Chengguang Xu wrote:
> 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@xxxxxxx>
> ---
>  drivers/s390/block/dasd.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
> index a23e7d394a0a..5e9ebdb0594c 100644
> --- a/drivers/s390/block/dasd.c
> +++ b/drivers/s390/block/dasd.c
> @@ -3309,10 +3309,8 @@ dasd_exit(void)
>  	dasd_proc_exit();
>  #endif
>  	dasd_eer_exit();
> -        if (dasd_page_cache != NULL) {
> -		kmem_cache_destroy(dasd_page_cache);
> -		dasd_page_cache = NULL;
> -	}
> +	kmem_cache_destroy(dasd_page_cache);
> +	dasd_page_cache = NULL;
>  	dasd_gendisk_exit();
>  	dasd_devmap_exit();
>  	if (dasd_debug_area != NULL) {
> 

Applied. Thanks a lot!

Regards,
Jan




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux