* [PATCH] staging: rtl8723bs: disable SDIO function on block size failure
@ 2026-07-31 16:17 Myeonghun Pak
2026-07-31 21:21 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-07-31 16:17 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Myeonghun Pak, Ijae Kim
sdio_init() enables the SDIO function before configuring the block
size. If sdio_set_block_size() fails, the function jumps to the release
path and returns the error without disabling the SDIO function. The
caller then frees the dvobj directly, so the enabled SDIO function is
left active on that probe failure path.
Disable the SDIO function before releasing the host when block size
configuration fails.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index c43a0391a5ca..47e87aaf76e2 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -122,8 +122,10 @@ static u32 sdio_init(struct dvobj_priv *dvobj)
goto release;
err = sdio_set_block_size(func, 512);
- if (err)
+ if (err) {
+ sdio_disable_func(func);
goto release;
+ }
psdio_data->block_transfer_len = 512;
psdio_data->tx_block_mode = 1;
--
2.47.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] staging: rtl8723bs: disable SDIO function on block size failure
2026-07-31 16:17 [PATCH] staging: rtl8723bs: disable SDIO function on block size failure Myeonghun Pak
@ 2026-07-31 21:21 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-07-31 21:21 UTC (permalink / raw)
To: Myeonghun Pak; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel, Ijae Kim
On Sat, Aug 01, 2026 at 01:17:10AM +0900, Myeonghun Pak wrote:
> sdio_init() enables the SDIO function before configuring the block
> size. If sdio_set_block_size() fails, the function jumps to the release
> path and returns the error without disabling the SDIO function. The
> caller then frees the dvobj directly, so the enabled SDIO function is
> left active on that probe failure path.
>
> Disable the SDIO function before releasing the host when block size
> configuration fails.
>
> This issue was identified during our ongoing static-analysis research while
> reviewing kernel code.
>
> Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
Looks good.
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-04 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 16:17 [PATCH] staging: rtl8723bs: disable SDIO function on block size failure Myeonghun Pak
2026-07-31 21:21 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox