From: Stanislaw Gruszka Date: Sat, 8 Jan 2011 14:24:37 +0000 (+0100) Subject: mtd: amd76xrom: fix oops at boot when resources are not available X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=82013d988fc03a1b908b2b0360a1e34f6152fda6;p=linux-beck.git mtd: amd76xrom: fix oops at boot when resources are not available For some unknown reasons resources needed by amd76xrom driver can be unavailable. And instead of returning an error, the driver keeps going and crash the kernel. This patch fixes the problem by making the driver return -EBUSY if the resources are not available. Commit messages tweaked by Artem. Reported-by: Russell Whitaker Signed-off-by: Stanislaw Gruszka Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse Cc: stable@kernel.org --- diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c index 77d64ce19e9f..92de7e3a49a5 100644 --- a/drivers/mtd/maps/amd76xrom.c +++ b/drivers/mtd/maps/amd76xrom.c @@ -151,6 +151,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev, printk(KERN_ERR MOD_NAME " %s(): Unable to register resource %pR - kernel bug?\n", __func__, &window->rsrc); + return -EBUSY; }