mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
i2c: davinci: Unregister cpufreq notifier on probe failure
davinci_i2c_probe() registers a cpufreq transition notifier before adding
the I2C adapter. If i2c_add_numbered_adapter() fails, the probe error path
releases the device resources without unregistering the notifier.
Add a dedicated error path to unregister the cpufreq notifier after
i2c_add_numbered_adapter() fails.
Fixes: 82c0de11b7 ("i2c: davinci: Add cpufreq support")
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Cc: <stable@vger.kernel.org> # v2.6.36+
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260610030513.2651018-1-haoxiang_li2024@163.com
This commit is contained in:
parent
f0285c286b
commit
e43f32816a
|
|
@ -818,12 +818,14 @@ static int davinci_i2c_probe(struct platform_device *pdev)
|
|||
adap->nr = pdev->id;
|
||||
r = i2c_add_numbered_adapter(adap);
|
||||
if (r)
|
||||
goto err_unuse_clocks;
|
||||
goto err_cpufreq;
|
||||
|
||||
pm_runtime_put_autosuspend(dev->dev);
|
||||
|
||||
return 0;
|
||||
|
||||
err_cpufreq:
|
||||
i2c_davinci_cpufreq_deregister(dev);
|
||||
err_unuse_clocks:
|
||||
pm_runtime_dont_use_autosuspend(dev->dev);
|
||||
pm_runtime_put_sync(dev->dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user