[<prev] [next>] [day] [month] [year] [list]
Message-id: <1206156029-2761-1-git-send-email-grant.likely@secretlab.ca>
Date: Fri, 21 Mar 2008 21:20:29 -0600
From: Grant Likely <grant.likely@...retlab.ca>
To: linux-kernel@...r.kernel.org, paulus@...ba.org,
linuxppc-dev@...abs.org
Cc: Grant Likely <grant.likely@...retlab.ca>
Subject: [PATCH] [POWERPC] mpc5200-fec: Fix possible NULL dereference in mdio
driver
If the reg property is missing from the phy node (unlikely, but possible),
then the kernel will oops with a NULL pointer dereference.
Signed-off-by: Grant Likely <grant.likely@...retlab.ca>
---
This one is a bugfix that should go in for 2.6.25. Paul, can you please
pick it up?
Thanks,
g.
drivers/net/fec_mpc52xx_phy.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c
index 1837584..6a3ac4e 100644
--- a/drivers/net/fec_mpc52xx_phy.c
+++ b/drivers/net/fec_mpc52xx_phy.c
@@ -109,7 +109,8 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of, const struct of_device_i
int irq = irq_of_parse_and_map(child, 0);
if (irq != NO_IRQ) {
const u32 *id = of_get_property(child, "reg", NULL);
- bus->irq[*id] = irq;
+ if (id)
+ bus->irq[*id] = irq;
}
}
--
1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists