xhci: host: potential NULL dereference in xhci_generic_plat_probe()
It's possible to exit the loop with "sysdev" set to NULL. In that case we should use "&pdev->dev". Fixes: ec5499d338ec ("xhci: split out rcar/rz support from xhci-plat.c") Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/Y+T4kTcJwRwxNHJq@kili Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c4a07e264d
commit
77191db5ba
@ -368,6 +368,9 @@ static int xhci_generic_plat_probe(struct platform_device *pdev)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!sysdev)
|
||||
sysdev = &pdev->dev;
|
||||
|
||||
if (WARN_ON(!sysdev->dma_mask)) {
|
||||
/* Platform did not initialize dma_mask */
|
||||
ret = dma_coerce_mask_and_coherent(sysdev, DMA_BIT_MASK(64));
|
||||
|
Loading…
x
Reference in New Issue
Block a user