Commit 243307a
wifi: brcmfmac: Fix potential kernel oops when probe fails
When probe of the sdio brcmfmac device fails for some reasons (i.e.
missing firmware), the sdiodev->bus is set to error instead of NULL, thus
the cleanup later in brcmf_sdio_remove() tries to free resources via
invalid bus pointer. This happens because sdiodev->bus is set 2 times:
first in brcmf_sdio_probe() and second time in brcmf_sdiod_probe(). Fix
this by chaning the brcmf_sdio_probe() function to return the error code
and set sdio->bus only there.
Fixes: 0ff0843 ("wifi: brcmfmac: Add optional lpo clock enable support")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Arend van Spriel<arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20260203102133.1478331-1-m.szyprowski@samsung.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>1 parent c854758 commit 243307a
3 files changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
954 | | - | |
955 | | - | |
956 | | - | |
| 954 | + | |
| 955 | + | |
957 | 956 | | |
958 | | - | |
| 957 | + | |
959 | 958 | | |
960 | 959 | | |
961 | 960 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4445 | 4445 | | |
4446 | 4446 | | |
4447 | 4447 | | |
4448 | | - | |
| 4448 | + | |
4449 | 4449 | | |
4450 | 4450 | | |
4451 | 4451 | | |
| |||
4551 | 4551 | | |
4552 | 4552 | | |
4553 | 4553 | | |
4554 | | - | |
| 4554 | + | |
4555 | 4555 | | |
4556 | 4556 | | |
4557 | 4557 | | |
4558 | | - | |
| 4558 | + | |
| 4559 | + | |
4559 | 4560 | | |
4560 | 4561 | | |
4561 | 4562 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
0 commit comments