clk: Do not dereference potential NULL pointer
PATCH 1/1 clk: Do not dereference potential NULL pointer
A NULL pointer may be passed to _clk_register() for the dev parameter (via clk_register()). Make sure not to dereference it before checking that it's valid.
--- drivers/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk.c +1 -1
@@ -1976,7 +1976,7 @@ static int _clk_register(struct device *dev, struct clk_hw *hw, struct clk *clk) hw->regmap = hw->init->regmap; else if (dev && dev_get_regmap(dev, NULL)) hw->regmap = dev_get_regmap(dev, NULL); - else if (dev->parent) + else if (dev && dev->parent) hw->regmap = dev_get_regmap(dev->parent, NULL);/* allocate local copy in case parent_names is __initdata */
Signature · 1 line
1.8.4
PATCH 1/1 clk: Do not dereference potential NULL pointer
Quoted 6 lines · Thierry Reding
A NULL pointer may be passed to
_clk_register()for the dev parameter (viaclk_register()). Make sure not to dereference it before checking that it's valid.Signed-off-by Thierry Reding <[email protected]>---
Ugh I had this fixed but didn't send it.
Quoted 16 lines
drivers/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/clk.c +1
-1@@ -1976,7 +1976,7 @@ static int _clk_register(struct device *dev, struct clk_hw *hw, struct clk *clk) hw->regmap = hw->init->regmap; else if (dev && dev_get_regmap(dev, NULL)) hw->regmap = dev_get_regmap(dev, NULL); - else if (dev->parent) + else if (dev && dev->parent) hw->regmap = dev_get_regmap(dev->parent, NULL);/* allocate local copy in case parent_names is __initdata */
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH 1/1 clk: Do not dereference potential NULL pointer
In reply to Thierry RedingQuoting Thierry Reding (2013-10-31 05:03:56)
Quoted 5 lines
A NULL pointer may be passed to
_clk_register()for the dev parameter (viaclk_register()). Make sure not to dereference it before checking that it's valid.Signed-off-by Thierry Reding <[email protected]>
Hi Thierry,
I saw Olof's fix first so I took that and applied your Ack.
Regards,
Mike
Quoted 19 lines
--- drivers/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/clk.c +1
-1@@ -1976,7 +1976,7 @@ static int _clk_register(struct device *dev, struct clk_hw *hw, struct clk *clk) hw->regmap = hw->init->regmap; else if (dev && dev_get_regmap(dev, NULL)) hw->regmap = dev_get_regmap(dev, NULL); - else if (dev->parent) + else if (dev && dev->parent) hw->regmap = dev_get_regmap(dev->parent, NULL);/* allocate local copy in case parent_names is __initdata */ Signature · 1 line
1.8.4
PATCH 1/1 clk: Do not dereference potential NULL pointer
Quoted 10 lines · Mike Turquette
Quoting Thierry Reding (2013-10-31 05:03:56)
Quoted 5 lines
A NULL pointer may be passed to
_clk_register()for the dev parameter (viaclk_register()). Make sure not to dereference it before checking that it's valid.Signed-off-by Thierry Reding <[email protected]>Hi Thierry,
I saw Olof's fix first so I took that and applied your Ack.
Perhaps we need a new kind of tag. Something like Also-by: =)
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131101/b86181ce/attachment.sig>