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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5E81748D-C6A8-4904-9A03-F61512AF22E5@maslowski.xyz>
Date:   Mon, 31 Jan 2022 23:33:49 +0100
From:   Piotr Masłowski <piotr@...lowski.xyz>
To:     marcan@...can.st
CC:     SHA-cyfmac-dev-list@...ineon.com, alyssa@...enzweig.io,
        andy.shevchenko@...il.com, arend.vanspriel@...adcom.com,
        aspriel@...il.com, brcm80211-dev-list.pdl@...adcom.com,
        davem@...emloft.net, devicetree@...r.kernel.org, digetx@...il.com,
        franky.lin@...adcom.com, hante.meuleman@...adcom.com,
        hdegoede@...hat.com, kettenis@...nbsd.org, kuba@...nel.org,
        kvalo@...eaurora.org, lenb@...nel.org, linus.walleij@...aro.org,
        linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-wireless@...r.kernel.org, linville@...driver.com,
        netdev@...r.kernel.org, pieter-paul.giesberts@...adcom.com,
        rafael@...nel.org, robh+dt@...nel.org,
        sandals@...stytoothpaste.net, sven@...npeter.dev,
        wright.feng@...ineon.com, zajec5@...il.com
Subject: Re: [PATCH v4 7/9] brcmfmac: of: Use devm_kstrdup for board_type & check for errors

On Mon, Jan 31, 2022 at 5:07 PM Hector Martin <marcan@...can.st> wrote:
>
>This was missing a NULL check, and we can collapse the strlen/alloc/copy
>into a devm_kstrdup().

...
 
> 		/* get rid of '/' in the compatible string to be able to find the FW */
> 		len = strlen(tmp) + 1;
>-		board_type = devm_kzalloc(dev, len, >GFP_KERNEL);
>-		strscpy(board_type, tmp, len);
>+		board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);

Also `len` can be dropped, since it is now unused.

--
Best regards,
Piotr Masłowski

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ