From: Ping-Ke Shih <pkshih@realtek.com>
To: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtlwifi: pci: fix error path in rtl_pci_probe()
Date: Thu, 23 Jul 2026 00:37:59 +0000 [thread overview]
Message-ID: <7fcf4f31fbcc48348496e564174ada91@realtek.com> (raw)
In-Reply-To: <20260722115217.131458-1-nihaal@cse.iitm.ac.in>
Abdun Nihaal <nihaal@cse.iitm.ac.in> wrote:
> In the last error path in rtl_pci_probe(), the cleanup functions are
> skipped due to a wrong goto label. Moreover, the successful call to
> rtl_init_rfkill() and ieee80211_register_hw() have to be reverted.
> Fix this issue by updating the labels and adding the relevant cleanup
> functions to the last error path.
>
> Fixes: 0c8173385e54 ("rtl8192ce: Add new driver")
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
> ---
> Compile tested only. Issue found using static analysis.
>
> drivers/net/wireless/realtek/rtlwifi/pci.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c
> b/drivers/net/wireless/realtek/rtlwifi/pci.c
> index 73018a0498b4..98365176a901 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/pci.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
> @@ -2227,13 +2227,16 @@ int rtl_pci_probe(struct pci_dev *pdev,
> rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG,
> "%s: failed to register IRQ handler\n",
> wiphy_name(hw->wiphy));
> - goto fail3;
> + goto fail6;
> }
> rtlpci->irq_alloc = 1;
>
> set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
> return 0;
>
> +fail6:
> + rtl_deinit_rfkill(hw);
rtl_debug_remove_one(hw) ?
> + ieee80211_unregister_hw(hw);
> fail5:
> rtl_pci_deinit(hw);
> fail4:
> --
> 2.43.0
prev parent reply other threads:[~2026-07-23 0:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 11:52 [PATCH] wifi: rtlwifi: pci: fix error path in rtl_pci_probe() Abdun Nihaal
2026-07-23 0:37 ` Ping-Ke Shih [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=7fcf4f31fbcc48348496e564174ada91@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