[3.13.y-ckt stable] Patch "mdio-sun4i: oops in error handling in probe" has been added to the 3.13.y-ckt tree
Kamal Mostafa
kamal at canonical.com
Mon Apr 4 23:22:00 UTC 2016
This is a note to let you know that I have just added a patch titled
mdio-sun4i: oops in error handling in probe
to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.13.y-queue
This patch is scheduled to be released in version 3.13.11-ckt38.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.13.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
---8<------------------------------------------------------------
>From 08fe7d61b5a82970b326be9ee0ea0be709868c3d Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter at oracle.com>
Date: Mon, 21 Mar 2016 12:02:31 +0300
Subject: mdio-sun4i: oops in error handling in probe
commit 227f33beab746aeec4ef3305bd17b1d374df09e7 upstream.
We could end up dereferencing an error pointer when we call
regulator_disable().
Fixes: 4bdcb1dd9feb ('net: Add MDIO bus driver for the Allwinner EMAC')
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
Acked-by: Chen-Yu Tsai <wens at csie.org>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
drivers/net/phy/mdio-sun4i.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/mdio-sun4i.c b/drivers/net/phy/mdio-sun4i.c
index 18969b3..1d76c1b 100644
--- a/drivers/net/phy/mdio-sun4i.c
+++ b/drivers/net/phy/mdio-sun4i.c
@@ -139,6 +139,7 @@ static int sun4i_mdio_probe(struct platform_device *pdev)
return -EPROBE_DEFER;
dev_info(&pdev->dev, "no regulator found\n");
+ data->regulator = NULL;
} else {
ret = regulator_enable(data->regulator);
if (ret)
@@ -154,7 +155,8 @@ static int sun4i_mdio_probe(struct platform_device *pdev)
return 0;
err_out_disable_regulator:
- regulator_disable(data->regulator);
+ if (data->regulator)
+ regulator_disable(data->regulator);
err_out_free_mdiobus:
mdiobus_free(bus);
return ret;
--
2.7.4
More information about the kernel-team
mailing list