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] [day] [month] [year] [list]
Message-ID: <YUWMZt81nViI7KiQ@kroah.com>
Date:   Sat, 18 Sep 2021 08:51:18 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     cgel.zte@...il.com
Cc:     Larry.Finger@...inger.net, dan.carpenter@...cle.com,
        phil@...lpotter.co.uk, straube.linux@...il.com,
        fmdefrancesco@...il.com, martin@...ser.cx,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Changcheng Deng <deng.changcheng@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH V2] staging: r8188eu: Use kzalloc() instead of
 kmalloc()+memset()

On Sat, Sep 18, 2021 at 03:51:41AM +0000, cgel.zte@...il.com wrote:
> From: Changcheng Deng <deng.changcheng@....com.cn>
> 
> This place can use kzalloc() directly instead of calling kmalloc() then
> memset(). Replace them.
> At the same time,error code that is "ret = -ENOMEM;" should be added
> here.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@....com.cn>
> ---
>  drivers/staging/r8188eu/os_dep/ioctl_linux.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> index ac218da94ce5..2fb34964f8c8 100644
> --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> @@ -463,11 +463,12 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
>  		if (wep_key_len > 0) {
>  			wep_key_len = wep_key_len <= 5 ? 5 : 13;
>  			wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
> -			pwep = kmalloc(wep_total_len, GFP_KERNEL);
> -			if (!pwep)
> +			pwep = kzalloc(wep_total_len, GFP_KERNEL);
> +			if (!pwep) {
> +				ret = -ENOMEM;
>  				goto exit;
> +			}
>  
> -			memset(pwep, 0, wep_total_len);
>  			pwep->KeyLength = wep_key_len;
>  			pwep->Length = wep_total_len;
>  			if (wep_key_len == 13) {
> -- 
> 2.25.1
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/SubmittingPatches for what needs to be done
  here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ