Message ID | 20200918125645.17309-1-zhangqilong3@huawei.com |
---|---|
State | Under Review |
Delegated to: | David Miller |
Headers | show |
Series | [-next] ide: add the return pointer check for plat_ide_probe | expand |
diff --git a/drivers/ide/ide_platform.c b/drivers/ide/ide_platform.c index 91639fd6c276..fdbc565ef142 100644 --- a/drivers/ide/ide_platform.c +++ b/drivers/ide/ide_platform.c @@ -86,6 +86,11 @@ static int plat_ide_probe(struct platform_device *pdev) res_alt->start, resource_size(res_alt)); } + if (!base || !alt_base) { + ret = -ENOMEM; + goto out; + } + memset(&hw, 0, sizeof(hw)); plat_ide_setup_ports(&hw, base, alt_base, pdata, res_irq->start); hw.dev = &pdev->dev;