Skip to content

Commit 9947726

Browse files
Colin Ian Kingtmlind
authored andcommitted
dmaengine: ti: omap-dma: don't allow a null od->plat pointer to be dereferenced
Currently when the call to dev_get_platdata returns null the driver issues a warning and then later dereferences the null pointer. Avoid this issue by returning -ENODEV error rather when the platform data is null and change the warning to an appropriate error message. Addresses-Coverity: ("Dereference after null check") Fixes: 211010a ("dmaengine: ti: omap-dma: Pass sdma auxdata to driver and use it") Signed-off-by: Colin Ian King <[email protected]> Acked-by: Peter Ujfalusi <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent 37b156e commit 9947726

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/dma/ti/omap-dma.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,8 +1658,10 @@ static int omap_dma_probe(struct platform_device *pdev)
16581658
if (conf) {
16591659
od->cfg = conf;
16601660
od->plat = dev_get_platdata(&pdev->dev);
1661-
if (!od->plat)
1662-
dev_warn(&pdev->dev, "no sdma auxdata needed?\n");
1661+
if (!od->plat) {
1662+
dev_err(&pdev->dev, "omap_system_dma_plat_info is missing");
1663+
return -ENODEV;
1664+
}
16631665
} else {
16641666
od->cfg = &default_cfg;
16651667

0 commit comments

Comments
 (0)