mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
usb: host: max3421-hcd: Fix error pointer dereference in probe cleanup
[ Upstream commit 186e8f2bdba551f3ae23396caccd452d985c23e3 ]
The kthread_run() function returns error pointers so the
max3421_hcd->spi_thread pointer can be either error pointers or NULL.
Check for both before dereferencing it.
Fixes: 05dfa5c9bc ("usb: host: max3421-hcd: fix "spi_rd8" uses dynamic stack allocation warning")
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
3e992a82d5
commit
89838fe5c6
1 changed files with 1 additions and 1 deletions
|
|
@ -1925,7 +1925,7 @@ error:
|
|||
if (hcd) {
|
||||
kfree(max3421_hcd->tx);
|
||||
kfree(max3421_hcd->rx);
|
||||
if (max3421_hcd->spi_thread)
|
||||
if (!IS_ERR_OR_NULL(max3421_hcd->spi_thread))
|
||||
kthread_stop(max3421_hcd->spi_thread);
|
||||
usb_put_hcd(hcd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue