From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Cc: Larry.Finger@lwfinger.net, gregkh@linuxfoundation.org,
linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: rtl8723au: Fix resource leak
Date: Mon, 28 Sep 2015 14:23:19 -0400 [thread overview]
Message-ID: <wrfjr3limmi0.fsf@redhat.com> (raw)
In-Reply-To: <1443383299-2634-1-git-send-email-mateusz.kulikowski@gmail.com> (Mateusz Kulikowski's message of "Sun, 27 Sep 2015 21:48:19 +0200")
Mateusz Kulikowski <mateusz.kulikowski@gmail.com> writes:
> Firmware was not released properly if kmemdup fails.
>
> Addresses-Coverity-Id: 1269118
> Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
> ---
> drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> index cd014f7..ecf54ee 100644
> --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> @@ -249,13 +249,13 @@ int rtl8723a_FirmwareDownload(struct rtw_adapter *padapter)
> goto Exit;
> }
> firmware_buf = kmemdup(fw->data, fw->size, GFP_KERNEL);
> + fw_size = fw->size;
> + release_firmware(fw);
> if (!firmware_buf) {
> rtStatus = _FAIL;
> goto Exit;
> }
> buf = firmware_buf;
> - fw_size = fw->size;
> - release_firmware(fw);
>
> /* To Check Fw header. Added by tynli. 2009.12.04. */
> pFwHdr = (struct rt_8723a_firmware_hdr *)firmware_buf;
prev parent reply other threads:[~2015-09-28 18:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-27 19:48 [PATCH v2] staging: rtl8723au: Fix resource leak Mateusz Kulikowski
2015-09-28 11:27 ` Sudip Mukherjee
2015-09-28 18:23 ` Jes Sorensen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wrfjr3limmi0.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mateusz.kulikowski@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).