Skip to content

Commit 90b12ae

Browse files
Amitkumar KarwarKalle Valo
authored andcommitted
rsi: fix error path handling in SDIO probe
We miss to release IRQ in certain error path in SDIO probe which causes following kernel panic. This patch corrects error path handling BUG: unable to handle kernel NULL pointer dereference at (null) IP: (null) PGD 0 P4D 0 Oops: 0010 [#1] SMP PTI Call Trace: <IRQ> ? call_timer_fn+0x29/0x120 ? run_timer_softirq+0x1da/0x420 ? timer_interrupt+0x11/0x20 ? __do_softirq+0xef/0x26e ? irq_exit+0xbe/0xd0 ? do_IRQ+0x4a/0xc0 ? common_interrupt+0xa2/0xa2 </IRQ> ? cpuidle_enter_state+0x118/0x250 ? do_idle+0x186/0x1e0 ? cpu_startup_entry+0x6f/0x80 ? start_kernel+0x47c/0x49c ? secondary_startup_64+0xa5/0xb0 Fixes: 5011760 ("rsi: improve RX handling in SDIO interface") Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent a31f931 commit 90b12ae

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎drivers/net/wireless/rsi/rsi_91x_sdio.c‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ static int rsi_probe(struct sdio_func *pfunction,
967967
rsi_sdio_rx_thread, "SDIO-RX-Thread");
968968
if (status) {
969969
rsi_dbg(ERR_ZONE, "%s: Unable to init rx thrd\n", __func__);
970-
goto fail_free_adapter;
970+
goto fail_kill_thread;
971971
}
972972
skb_queue_head_init(&sdev->rx_q.head);
973973
sdev->rx_q.num_rx_pkts = 0;
@@ -977,15 +977,15 @@ static int rsi_probe(struct sdio_func *pfunction,
977977
rsi_dbg(ERR_ZONE, "%s: Failed to request IRQ\n", __func__);
978978
sdio_release_host(pfunction);
979979
status = -EIO;
980-
goto fail_kill_thread;
980+
goto fail_claim_irq;
981981
}
982982
sdio_release_host(pfunction);
983983
rsi_dbg(INIT_ZONE, "%s: Registered Interrupt handler\n", __func__);
984984

985985
if (rsi_hal_device_init(adapter)) {
986986
rsi_dbg(ERR_ZONE, "%s: Failed in device init\n", __func__);
987987
status = -EINVAL;
988-
goto fail_kill_thread;
988+
goto fail_dev_init;
989989
}
990990
rsi_dbg(INFO_ZONE, "===> RSI Device Init Done <===\n");
991991

@@ -1002,10 +1002,13 @@ static int rsi_probe(struct sdio_func *pfunction,
10021002
fail_dev_init:
10031003
sdio_claim_host(pfunction);
10041004
sdio_release_irq(pfunction);
1005-
sdio_disable_func(pfunction);
10061005
sdio_release_host(pfunction);
1007-
fail_kill_thread:
1006+
fail_claim_irq:
10081007
rsi_kill_thread(&sdev->rx_thread);
1008+
fail_kill_thread:
1009+
sdio_claim_host(pfunction);
1010+
sdio_disable_func(pfunction);
1011+
sdio_release_host(pfunction);
10091012
fail_free_adapter:
10101013
rsi_91x_deinit(adapter);
10111014
rsi_dbg(ERR_ZONE, "%s: Failed in probe...Exiting\n", __func__);

0 commit comments

Comments
 (0)