mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Abdun Nihaal <nihaal@cse.iitm.ac.in>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] rtl818x_pci: Fix potential memory leaks in rtl8180_init_rx_ring()
Date: Fri, 14 Nov 2025 07:20:05 +0000	[thread overview]
Message-ID: <dc6974f6c9f04ac68d0b10a427b0abd0@realtek.com> (raw)
In-Reply-To: <20251113165851.39054-1-nihaal@cse.iitm.ac.in>

Abdun Nihaal <nihaal@cse.iitm.ac.in> wrote:
> In rtl8180_init_rx_ring(), memory is allocated for skb packets and DMA
> allocations in a loop. When an allocation fails, the previously
> successful allocations are not freed on exit.
> 
> Fixes: f653211197f3 ("Add rtl8180 wireless driver")
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
> ---
> Compile tested only.
> 

I'm surprised that people work on this old driver, and how did you find
this flaw?


It seems like rtl8180_free_rx_ring() does all things you are adding, so
just goto err_free_rings?

@@ -1130,7 +1131,7 @@ static int rtl8180_start(struct ieee80211_hw *dev)

        ret = rtl8180_init_rx_ring(dev);
        if (ret)
-               return ret;
+               goto err_free_rings;

        for (i = 0; i < (dev->queues + 1); i++)
                if ((ret = rtl8180_init_tx_ring(dev, i, 16)))



  reply	other threads:[~2025-11-14  7:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 16:58 Abdun Nihaal
2025-11-14  7:20 ` Ping-Ke Shih [this message]
2025-11-14  9:00   ` Abdun Nihaal

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=dc6974f6c9f04ac68d0b10a427b0abd0@realtek.com \
    --to=pkshih@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nihaal@cse.iitm.ac.in \
    /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

all inboxes | Powered by JetHome®