summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/nct6683.c
diff options
context:
space:
mode:
authorAxel Lin2014-05-24 17:04:22 +0200
committerGuenter Roeck2014-05-24 17:28:24 +0200
commit30190c3c6181470203e6f635166496aa640ffe06 (patch)
tree7d2ea782fed9f713a33122c81a5210a9a11d350b /drivers/hwmon/nct6683.c
parenthwmon: (ultra45_env) Introduce managed version of kzalloc (diff)
downloadkernel-qcow2-linux-30190c3c6181470203e6f635166496aa640ffe06.tar.gz
kernel-qcow2-linux-30190c3c6181470203e6f635166496aa640ffe06.tar.xz
kernel-qcow2-linux-30190c3c6181470203e6f635166496aa640ffe06.zip
hwmon: (nct6683) Fix probe unwind paths to properly unregister platform devices
Call platform_device_unregister() rather than platform_device_put() to unregister successfully registered platform devices. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/nct6683.c')
-rw-r--r--drivers/hwmon/nct6683.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c
index 540c81c52344..7710f4694ba1 100644
--- a/drivers/hwmon/nct6683.c
+++ b/drivers/hwmon/nct6683.c
@@ -1389,7 +1389,7 @@ static int __init sensors_nct6683_init(void)
pdev[i] = platform_device_alloc(DRVNAME, address);
if (!pdev[i]) {
err = -ENOMEM;
- goto exit_device_put;
+ goto exit_device_unregister;
}
err = platform_device_add_data(pdev[i], &sio_data,
@@ -1427,9 +1427,11 @@ static int __init sensors_nct6683_init(void)
return 0;
exit_device_put:
- for (i = 0; i < ARRAY_SIZE(pdev); i++) {
+ platform_device_put(pdev[i]);
+exit_device_unregister:
+ while (--i >= 0) {
if (pdev[i])
- platform_device_put(pdev[i]);
+ platform_device_unregister(pdev[i]);
}
exit_unregister:
platform_driver_unregister(&nct6683_driver);