diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-07 16:11:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-07 16:11:36 -0400 |
commit | 92556e60394a78c2c0d6958602271676094858bc (patch) | |
tree | c94054f456d4d7c23b322918e0a6350e75303c97 | |
parent | cd3de83f147601356395b57a8673e9c5ff1e59d1 (diff) | |
parent | 1419d8151be990f115c38deac497ad84d26434dd (diff) |
Merge tag 'pinctrl-v3.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij:
"Two fixes for the pin control subsystem, both relating to the error
path in probe()
I'm a bit snowed under by mail but these have boiled in linux-next and
should propagate to you"
* tag 'pinctrl-v3.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: berlin: fix an error code in berlin_pinctrl_probe()
pinctrl: sunxi: Fix potential null pointer dereference
-rw-r--r-- | drivers/pinctrl/berlin/berlin.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sunxi.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c index edf5d2fd2b22..86db2235ab00 100644 --- a/drivers/pinctrl/berlin/berlin.c +++ b/drivers/pinctrl/berlin/berlin.c | |||
@@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev, | |||
320 | 320 | ||
321 | regmap = dev_get_regmap(&pdev->dev, NULL); | 321 | regmap = dev_get_regmap(&pdev->dev, NULL); |
322 | if (!regmap) | 322 | if (!regmap) |
323 | return PTR_ERR(regmap); | 323 | return -ENODEV; |
324 | 324 | ||
325 | pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); | 325 | pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); |
326 | if (!pctrl) | 326 | if (!pctrl) |
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index f1ca75e6d7b1..5f38c7f67834 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c | |||
@@ -211,6 +211,10 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, | |||
211 | configlen++; | 211 | configlen++; |
212 | 212 | ||
213 | pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); | 213 | pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); |
214 | if (!pinconfig) { | ||
215 | kfree(*map); | ||
216 | return -ENOMEM; | ||
217 | } | ||
214 | 218 | ||
215 | if (!of_property_read_u32(node, "allwinner,drive", &val)) { | 219 | if (!of_property_read_u32(node, "allwinner,drive", &val)) { |
216 | u16 strength = (val + 1) * 10; | 220 | u16 strength = (val + 1) * 10; |