From: Dan Carpenter <error27@gmail.com>
To: Omer El Idrissi <omer.e.idrissi@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] staging: rtl8723bs: replace function with error handling alternative
Date: Wed, 1 Apr 2026 11:46:23 +0300 [thread overview]
Message-ID: <aczbXwM38nUDTUpz@stanley.mountain> (raw)
In-Reply-To: <20260331153255.22764-5-omer.e.idrissi@gmail.com>
On Tue, Mar 31, 2026 at 05:32:53PM +0200, Omer El Idrissi wrote:
> Replace the use of rtw_set_hal_ops with rtw_hal_data_init in
> rtw_sdio_if1_init , which actually returns error or success and not
> void.
> rtw_set_hal_ops literally only calls rtw_hal_data_init and just ignores the
> possibility of errors.
>
This is a behavior change and it's quite dangerous. A lot of code only
works because there is no error handling. We can't merge it without
testing unless it causes a security issue or something. For example,
not checking the results of allocations could cause a crash so maybe
that's a security bug.
> @@ -250,8 +244,9 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
> /* 3 3. init driver special setting, interface, OS and hardware relative */
>
> /* 4 3.1 set hardware operation functions */
> - rtw_set_hal_ops(padapter);
> -
> + /* allocates padapter->HalData */
> + if (rtw_hal_data_init(padapter))
> + goto free_adapter;
I don't want to see checks in this style. I always want them to be
in this format:
ret = rtw_hal_data_init(padapter);
if (ret)
...
But in this case, just leave it because adding a new check would have
to be tested.
regards,
dan carpenter
>
> /* 3 5. initialize Chip version */
> padapter->intf_start = &sd_intf_start;
> --
> 2.51.0
>
next prev parent reply other threads:[~2026-04-01 8:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 15:32 [PATCH 0/5] rtw_sdio_if1_init cleanup and small logic tweak Omer El Idrissi
2026-03-31 15:32 ` [PATCH 1/5] staging: rtl8723bs: use direct returns in rtw_sdio_if1_init Omer El Idrissi
2026-03-31 15:32 ` [PATCH 2/5] staging: rtl8723bs: remove useless line " Omer El Idrissi
2026-03-31 15:32 ` [PATCH 3/5] staging: rtl8723bs: remove use of vendor-defined status macros Omer El Idrissi
2026-04-01 8:42 ` Dan Carpenter
2026-03-31 15:32 ` [PATCH 4/5] staging: rtl8723bs: replace function with error handling alternative Omer El Idrissi
2026-04-01 8:46 ` Dan Carpenter [this message]
2026-03-31 15:32 ` [PATCH 5/5] staging: rtl8723bs: add separate label for freeing rtw_wdev Omer El Idrissi
2026-04-01 8:59 ` Dan Carpenter
2026-04-01 1:39 ` [PATCH 0/5] rtw_sdio_if1_init cleanup and small logic tweak Ethan Tidmore
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=aczbXwM38nUDTUpz@stanley.mountain \
--to=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=omer.e.idrissi@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