[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yg5ibnScTz37yfCw@kroah.com>
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