mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
soc: mediatek: PMIC wrap: Fix possible NULL derefrence.
of_match_device could return NULL, and so can cause a NULL pointer dereference later. Signed-off-by: Shailendra Verma <[email protected]> Signed-off-by: Matthias Brugger <[email protected]>
This commit is contained in:
parent
f282693f80
commit
58a823dd7b
1 changed files with 5 additions and 0 deletions
|
|
@ -1117,6 +1117,11 @@ static int pwrap_probe(struct platform_device *pdev)
|
|||
const struct of_device_id *of_slave_id = NULL;
|
||||
struct resource *res;
|
||||
|
||||
if (!of_id) {
|
||||
dev_err(&pdev->dev, "Error: No device match found\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (pdev->dev.of_node->child)
|
||||
of_slave_id = of_match_node(of_slave_match_tbl,
|
||||
pdev->dev.of_node->child);
|
||||
|
|
|
|||
Loading…
Reference in a new issue