Commit 18632f84fac770125c0982dfadec6b551e82144e

Authored by Hans de Goede
Committed by Jean Delvare
1 parent 603eaa1bdd

hwmon: Fix ACPI resource check error handling

This patch fixes a number of cases where things were not properly
cleaned up when acpi_check_resource_conflict() returned an error,
causing oopses such as the one reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=483208

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>

Showing 3 changed files with 3 additions and 3 deletions Side-by-side Diff

drivers/hwmon/f71882fg.c
... ... @@ -1932,7 +1932,7 @@
1932 1932 res.name = f71882fg_pdev->name;
1933 1933 err = acpi_check_resource_conflict(&res);
1934 1934 if (err)
1935   - return err;
  1935 + goto exit_device_put;
1936 1936  
1937 1937 err = platform_device_add_resources(f71882fg_pdev, &res, 1);
1938 1938 if (err) {
drivers/hwmon/vt1211.c
... ... @@ -1262,7 +1262,7 @@
1262 1262 res.name = pdev->name;
1263 1263 err = acpi_check_resource_conflict(&res);
1264 1264 if (err)
1265   - goto EXIT;
  1265 + goto EXIT_DEV_PUT;
1266 1266  
1267 1267 err = platform_device_add_resources(pdev, &res, 1);
1268 1268 if (err) {
drivers/hwmon/w83627ehf.c
... ... @@ -1548,7 +1548,7 @@
1548 1548  
1549 1549 err = acpi_check_resource_conflict(&res);
1550 1550 if (err)
1551   - goto exit;
  1551 + goto exit_device_put;
1552 1552  
1553 1553 err = platform_device_add_resources(pdev, &res, 1);
1554 1554 if (err) {