Skip to content

Commit

Permalink
extcon: palmas: Fix NULL pointer error
Browse files Browse the repository at this point in the history
This patch fixes NULL pointer error by removing the unneeded kfree() call
of edev->name because extcon-palmas no longer allocate the memory for edev->name.

Fixes: d71aadd ("extcon: Remove the optional name of extcon device")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
  • Loading branch information
Chanwoo Choi committed Jul 29, 2015
1 parent cbfe8fa commit e350f80
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions drivers/extcon/extcon-palmas.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ static int palmas_usb_probe(struct platform_device *pdev)
status = devm_extcon_dev_register(&pdev->dev, palmas_usb->edev);
if (status) {
dev_err(&pdev->dev, "failed to register extcon device\n");
kfree(palmas_usb->edev->name);
return status;
}

Expand All @@ -214,7 +213,6 @@ static int palmas_usb_probe(struct platform_device *pdev)
if (status < 0) {
dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
palmas_usb->id_irq, status);
kfree(palmas_usb->edev->name);
return status;
}
}
Expand All @@ -229,7 +227,6 @@ static int palmas_usb_probe(struct platform_device *pdev)
if (status < 0) {
dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
palmas_usb->vbus_irq, status);
kfree(palmas_usb->edev->name);
return status;
}
}
Expand All @@ -239,15 +236,6 @@ static int palmas_usb_probe(struct platform_device *pdev)
return 0;
}

static int palmas_usb_remove(struct platform_device *pdev)
{
struct palmas_usb *palmas_usb = platform_get_drvdata(pdev);

kfree(palmas_usb->edev->name);

return 0;
}

#ifdef CONFIG_PM_SLEEP
static int palmas_usb_suspend(struct device *dev)
{
Expand Down Expand Up @@ -288,7 +276,6 @@ static const struct of_device_id of_palmas_match_tbl[] = {

static struct platform_driver palmas_usb_driver = {
.probe = palmas_usb_probe,
.remove = palmas_usb_remove,
.driver = {
.name = "palmas-usb",
.of_match_table = of_palmas_match_tbl,
Expand Down

0 comments on commit e350f80

Please sign in to comment.