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]
Date:   Thu, 17 Feb 2022 15:57:50 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     xkernel.wang@...mail.com
Cc:     jerome.pouiller@...abs.com, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] staging: wfx: check the return value of devm_kmalloc()

On Wed, Feb 16, 2022 at 08:25:20PM +0800, xkernel.wang@...mail.com wrote:
> From: Xiaoke Wang <xkernel.wang@...mail.com>
> 
> devm_kmalloc() returns a pointer to allocated memory on success, NULL
> on failure. While there is a memory allocation of devm_kmalloc()
> without proper check. It is better to check the return value of it to
> prevent wrong memory access.
> By the way, all the error handlers of this function return without
> calling ieee80211_free_hw(hw), which may result in memory leak. So I
> add one err label to unify the error handler.

This is doing 2 different things in one patch.  Please submit this as 2
different patches, the first one doing the error handling for the
existing "return" statements, and then the second one for the
devm_kmalloc() test.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ