DHD: 4398 - Fix KP during dhd_prot_reset when htput flowring buf malloc fails during init
KP reported by customer due to failure of malloc for htput ring buf:
[ 17.088063][ T1093] [09:40:43.728565][dhd][wlan]dhd_dma_buf_alloc: buf_len 327680, no memory available
[ 17.088070][ T1093] [09:40:43.728572][dhd][wlan]dhd_prot_allocate_bufs: dhd_prot_ring_attach D2H Rx Completion failed
[ 17.088091][ T1093] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030
...
[ 17.089190][ T1093] dhd_prot_reset+0x61c/0x8e0 [bcmdhd4398]
[ 17.089399][ T1093] dhd_prot_detach+0x34/0xcd4 [bcmdhd4398]
[ 17.089607][ T1093] dhd_prot_attach+0x690/0xc74 [bcmdhd4398]
[ 17.089812][ T1093] dhd_attach+0x5b4/0x1f6c [bcmdhd4398]
[ 17.090020][ T1093] dhdpcie_bus_attach+0x18c/0x868 [bcmdhd4398]
[ 17.090225][ T1093] dhdpcie_pci_probe+0x89c/0x107c [bcmdhd4398]
Fixed by adding null checks in prot detach and reset path
Bug: 299597777
Test: Simulated the problem on hikey by making
'prot->prealloc_htput_flowring_buf = NULL;' during dhd_prot_attach().
KP is seen without fix in both dhd_prot_reset and dhd_prot_detach paths.
KP not seen with fix.
Change-Id: I98e30a18719323ec73d3a5a4597f2f9049e0b545
Signed-off-by: Yadukishore Kodicherla <yadukishore.kodicherla@broadcom.corp-partner.google.com>
1 file changed