提交 92556e60 编写于 作者: L Linus Torvalds

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
...@@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev, ...@@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
regmap = dev_get_regmap(&pdev->dev, NULL); regmap = dev_get_regmap(&pdev->dev, NULL);
if (!regmap) if (!regmap)
return PTR_ERR(regmap); return -ENODEV;
pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
if (!pctrl) if (!pctrl)
......
...@@ -211,6 +211,10 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -211,6 +211,10 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
configlen++; configlen++;
pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL);
if (!pinconfig) {
kfree(*map);
return -ENOMEM;
}
if (!of_property_read_u32(node, "allwinner,drive", &val)) { if (!of_property_read_u32(node, "allwinner,drive", &val)) {
u16 strength = (val + 1) * 10; u16 strength = (val + 1) * 10;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册