Skip to content

Commit 4cbb0d3

Browse files
void0redsre
authored andcommitted
power: supply: mt6360: add a check of devm_work_autocancel in mt6360_charger_probe
devm_work_autocancel may fail, add a check and return early. Fixes: 0402e8e ("power: supply: mt6360_charger: add MT6360 charger support") Signed-off-by: Kang Chen <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent b2f2a3c commit 4cbb0d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/power/supply/mt6360_charger.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,9 @@ static int mt6360_charger_probe(struct platform_device *pdev)
796796
mci->vinovp = 6500000;
797797
mutex_init(&mci->chgdet_lock);
798798
platform_set_drvdata(pdev, mci);
799-
devm_work_autocancel(&pdev->dev, &mci->chrdet_work, mt6360_chrdet_work);
799+
ret = devm_work_autocancel(&pdev->dev, &mci->chrdet_work, mt6360_chrdet_work);
800+
if (ret)
801+
return dev_err_probe(&pdev->dev, ret, "Failed to set delayed work\n");
800802

801803
ret = device_property_read_u32(&pdev->dev, "richtek,vinovp-microvolt", &mci->vinovp);
802804
if (ret)

0 commit comments

Comments
 (0)