From: Greg KH <gregkh@linuxfoundation.org>
To: "Bera Yüzlü" <b9788213@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
ethantidmore06@gmail.com
Subject: Re: [PATCH] staging: rtl8723bs: Simplify error handling
Date: Thu, 12 Mar 2026 14:31:34 +0100 [thread overview]
Message-ID: <2026031232-mushy-demeanor-299c@gregkh> (raw)
In-Reply-To: <20260312131933.29505-2-b9788213@gmail.com>
On Thu, Mar 12, 2026 at 04:19:34PM +0300, Bera Yüzlü wrote:
> Remove unnecessary ret variable and goto exit pattern. The function now
> returns immediately when an error occurs.
>
> Signed-off-by: Bera Yüzlü <b9788213@gmail.com>
> ---
> drivers/staging/rtl8723bs/os_dep/os_intfs.c | 30 +++++++--------------
> 1 file changed, 10 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> index 7ba689f2d..fe910cc68 100644
> --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> @@ -1124,36 +1124,27 @@ static int rtw_resume_process_normal(struct adapter *padapter)
> struct pwrctrl_priv *pwrpriv;
> struct mlme_priv *pmlmepriv;
>
> - int ret = _SUCCESS;
> -
> - if (!padapter) {
> - ret = -1;
> - goto exit;
> - }
> + if (!padapter)
> + return -1;
>
> pnetdev = padapter->pnetdev;
> pwrpriv = adapter_to_pwrctl(padapter);
> pmlmepriv = &padapter->mlmepriv;
> /* interface init */
> /* if (sdio_init(adapter_to_dvobj(padapter)) != _SUCCESS) */
> - if ((padapter->intf_init) && (padapter->intf_init(adapter_to_dvobj(padapter)) != _SUCCESS)) {
> - ret = -1;
> - goto exit;
> - }
> + if ((padapter->intf_init) && (padapter->intf_init(adapter_to_dvobj(padapter)) != _SUCCESS))
> + return -1;
I understand the goal here, but are you sure that just exiting like this
in all of these places is actually correct? Nothing needs to be
"unwound"?
> +
> rtw_hal_disable_interrupt(padapter);
> /* if (sdio_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS) */
> - if ((padapter->intf_alloc_irq) && (padapter->intf_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS)) {
> - ret = -1;
> - goto exit;
> - }
> + if ((padapter->intf_alloc_irq) && (padapter->intf_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS))
> + return -1;
>
> rtw_reset_drv_sw(padapter);
> pwrpriv->bkeepfwalive = false;
>
> - if (pm_netdev_open(pnetdev, true) != 0) {
> - ret = -1;
> - goto exit;
> - }
> + if (pm_netdev_open(pnetdev, true) != 0)
> + return -1;
Like here, the irq is allocated, but an error happened, so what happened
to that irq?
thanks,
greg k-h
next prev parent reply other threads:[~2026-03-12 13:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 13:19 [PATCH] staging: rtl8723bs: Simplify error handling Bera Yüzlü
2026-03-12 13:31 ` Greg KH [this message]
2026-03-12 16:43 ` Bera Yüzlü
2026-03-12 17:20 ` Greg KH
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=2026031232-mushy-demeanor-299c@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=b9788213@gmail.com \
--cc=ethantidmore06@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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