mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
usb: renesas_usbhs: fix NULL pointer dereference in dma_release_channel()
This patch fixes an issue that the following commit causes NULL
pointer dereference in dma_release_channel().
"usb: renesas_usbhs: add support for requesting DT DMA"
(commit id abd2dbf6bb)
The usbhsf_dma_init_dt() should set fifo->{t,r}x_chan to NULL if
dma_request_slave_channel_reason() returns IS_ERR value.
Otherwise, usbhsf_dma_quit() will call dma_release_channel(), and then
NULL pointer dereference happens.
Acked-by: Geert Uytterhoeven <[email protected]>
Tested-by: Simon Horman <[email protected]>
Reported-by: Simon Horman <[email protected]>
Signed-off-by: Yoshihiro Shimoda <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
0f4ff5f1f9
commit
ffb9da6575
1 changed files with 4 additions and 0 deletions
|
|
@ -1072,7 +1072,11 @@ static void usbhsf_dma_init_pdev(struct usbhs_fifo *fifo)
|
|||
static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo)
|
||||
{
|
||||
fifo->tx_chan = dma_request_slave_channel_reason(dev, "tx");
|
||||
if (IS_ERR(fifo->tx_chan))
|
||||
fifo->tx_chan = NULL;
|
||||
fifo->rx_chan = dma_request_slave_channel_reason(dev, "rx");
|
||||
if (IS_ERR(fifo->rx_chan))
|
||||
fifo->rx_chan = NULL;
|
||||
}
|
||||
|
||||
static void usbhsf_dma_init(struct usbhs_priv *priv,
|
||||
|
|
|
|||
Loading…
Reference in a new issue