lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yt9dy200xnh5.fsf@linux.ibm.com>
Date:   Wed, 20 Apr 2022 08:44:54 +0200
From:   Sven Schnelle <svens@...ux.ibm.com>
To:     Haowen Bai <baihaowen@...zu.com>
Cc:     <agordeev@...ux.ibm.com>, <borntraeger@...ux.ibm.com>,
        <gor@...ux.ibm.com>, <hca@...ux.ibm.com>, <hoeppner@...ux.ibm.com>,
        <linux-kernel@...r.kernel.org>, <linux-s390@...r.kernel.org>,
        <sth@...ux.ibm.com>
Subject: Re: [PATCH V2] s390/dasd: Use kzalloc instead of kmalloc/memset

Haowen Bai <baihaowen@...zu.com> writes:

> Use kzalloc rather than duplicating its implementation, which
> makes code simple and easy to understand.
>
> Signed-off-by: Haowen Bai <baihaowen@...zu.com>
> ---
> V1->V2: also remove the isglobal assigment above, so the whole else block
> could go away
>
>  drivers/s390/block/dasd_eckd.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
> index 8410a25a65c1..6b70f9dfff02 100644
> --- a/drivers/s390/block/dasd_eckd.c
> +++ b/drivers/s390/block/dasd_eckd.c
> @@ -1480,7 +1480,7 @@ static int dasd_eckd_pe_handler(struct dasd_device *device,
>  {
>  	struct pe_handler_work_data *data;
>  
> -	data = kmalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA);
> +	data = kzalloc(sizeof(*data), GFP_ATOMIC | GFP_DMA);
>  	if (!data) {
>  		if (mutex_trylock(&dasd_pe_handler_mutex)) {
>  			data = pe_handler_worker;
> @@ -1488,9 +1488,6 @@ static int dasd_eckd_pe_handler(struct dasd_device *device,
>  		} else {
>  			return -ENOMEM;
>  		}
> -	} else {
> -		memset(data, 0, sizeof(*data));
> -		data->isglobal = 0;
>  	}
>  	INIT_WORK(&data->worker, do_pe_handler_work);
>  	dasd_get_device(device);

Reviewed-by: Sven Schnelle <svens@...ux.ibm.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ