mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
iio: adc: sun4i-gpadc-iio: clean up on thermal zone registration failure
If devm_thermal_of_zone_register() fails, probe returns without
unregistering the IIO map array or disabling runtime PM.
Jump to err_map to release them.
Fixes: b0a242894f ("iio: adc: sun4i-gpadc-iio: register in the thermal after registering in pm")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
parent
8b958dd214
commit
2cdc7ef318
|
|
@ -638,10 +638,10 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
|
|||
* thermal because no thermal DT node is found.
|
||||
*/
|
||||
if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) {
|
||||
dev_err(&pdev->dev,
|
||||
"could not register thermal sensor: %ld\n",
|
||||
PTR_ERR(info->tzd));
|
||||
return PTR_ERR(info->tzd);
|
||||
ret = dev_err_probe(&pdev->dev,
|
||||
PTR_ERR(info->tzd),
|
||||
"could not register thermal sensor\n");
|
||||
goto err_map;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user