ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe()
Replace the BUG_ON() with returning error code to handle the fault more gracefully. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
985e254c73
Коммит
60d78e9fce
|
@ -2534,7 +2534,12 @@ static int sbmac_probe(struct platform_device *pldev)
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
res = platform_get_resource(pldev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pldev, IORESOURCE_MEM, 0);
|
||||||
BUG_ON(!res);
|
if (!res) {
|
||||||
|
printk(KERN_ERR "%s: failed to get resource\n",
|
||||||
|
dev_name(&pldev->dev));
|
||||||
|
err = -EINVAL;
|
||||||
|
goto out_out;
|
||||||
|
}
|
||||||
sbm_base = ioremap(res->start, resource_size(res));
|
sbm_base = ioremap(res->start, resource_size(res));
|
||||||
if (!sbm_base) {
|
if (!sbm_base) {
|
||||||
printk(KERN_ERR "%s: unable to map device registers\n",
|
printk(KERN_ERR "%s: unable to map device registers\n",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче