linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: nbd@nbd.name, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wifi: mt76: mt7921: fix memory leak in mt7921_check_offload_capability
Date: Mon, 16 Jan 2023 13:33:58 +0100	[thread overview]
Message-ID: <Y8VENgmxvMA2i3XE@lore-desk> (raw)
In-Reply-To: <39ebf05085dd3069412c001ca9a31aa259de5a74.1672742135.git.lorenzo@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]

> Fix possible memory leak in mt7921_check_offload_capability routine
> relasing fw data.
> 
> Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7921/init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Felix,

This issue has already a fix in your tree, we can drop the patch as well.

Regards,
Lorenzo

> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> index 542dfd425129..5ec0caa23c23 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> @@ -175,7 +175,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
>  
>  	if (!fw || !fw->data || fw->size < sizeof(*hdr)) {
>  		dev_err(dev, "Invalid firmware\n");
> -		return -EINVAL;
> +		goto out;
>  	}
>  
>  	data = fw->data;
> @@ -205,7 +205,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
>  
>  		data += le16_to_cpu(rel_info->len) + rel_info->pad_len;
>  	}
> -
> +out:
>  	release_firmware(fw);
>  
>  	return features ? features->data : 0;
> -- 
> 2.39.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2023-01-16 12:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 10:36 [PATCH] wifi: mt76: mt7921: fix memory leak in mt7921_check_offload_capability Lorenzo Bianconi
2023-01-16 12:33 ` Lorenzo Bianconi [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=Y8VENgmxvMA2i3XE@lore-desk \
    --to=lorenzo.bianconi@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    /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).