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: <52642929-cec1-d03b-03f1-130a54c0c289@gmail.com>
Date:   Sat, 4 Sep 2021 15:10:57 +0530
From:   Saurav Girepunje <saurav.girepunje@...il.com>
To:     Phillip Potter <phil@...lpotter.co.uk>
Cc:     saurav.girepunje@...mail.com,
        Larry Finger <Larry.Finger@...inger.net>,
        Greg KH <gregkh@...uxfoundation.org>,
        Michael Straube <straube.linux@...il.com>,
        Martin Kaiser <martin@...ser.cx>,
        "open list:STAGING SUBSYSTEM" <linux-staging@...ts.linux.dev>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: r8188eu: os_dep: use kmemdup instead of kzalloc
 and memcpy



On 04/09/21 12:23 am, Phillip Potter wrote:
> On Fri, 3 Sept 2021 at 18:56, Saurav Girepunje
> <saurav.girepunje@...il.com> wrote:
>>
>> Fixes coccicheck warning:WARNING opportunity for kmemdup in ioctl_linux.c
>>
>> Signed-off-by: Saurav Girepunje <saurav.girepunje@...il.com>
>> ---
>>   drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
>> index 81d4255d1785..495fadd2b8c8 100644
>> --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
>> +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
>> @@ -585,14 +585,12 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
>>          }
>>
>>          if (ielen) {
>> -               buf = kzalloc(ielen, GFP_KERNEL);
>> +               buf = kmemdup(pie, ielen, GFP_KERNEL);
>>                  if (!buf) {
>>                          ret =  -ENOMEM;
>>                          goto exit;
>>                  }
>>
>> -               memcpy(buf, pie, ielen);
>> -
>>                  /* dump */
>>                  {
>>                          int i;
>> --
>> 2.32.0
>>
> 
> Dear Saurav,
> 
> Looks good, thanks:
> Acked-by: Phillip Potter <phil@...lpotter.co.uk>
> 
> Regards,
> Phil
> 

Thanks for review Phil

Regards,
Saurav Girepunje

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ