projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1fefca6
)
hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe()
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Sun, 3 Dec 2023 15:24:05 +0000
(16:24 +0100)
committer
Guenter Roeck
<linux@roeck-us.net>
Sun, 3 Dec 2023 17:07:26 +0000
(09:07 -0800)
There is no point in calling hid_hw_stop() if hid_hw_start() has failed.
There is no point in calling hid_hw_close() if hid_hw_open() has failed.
Update the error handling path accordingly.
Fixes:
82e3430dfa8c
("hwmon: add driver for NZXT Kraken X42/X52/X62/X72")
Reported-by: Aleksa Savic <savicaleksa83@gmail.com>
Closes: https://lore.kernel.org/all/
121470f0
-6c1f-418a-844c-
7ec2e8a54b8e
@gmail.com/
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jonas Malaco <jonas@protocubo.io>
Link:
https://lore.kernel.org/r/a768e69851a07a1f4e29f270f4e2559063f07343.1701617030.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/nzxt-kraken2.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/nzxt-kraken2.c
b/drivers/hwmon/nzxt-kraken2.c
index
428c77b
..
7caf387
100644
(file)
--- a/
drivers/hwmon/nzxt-kraken2.c
+++ b/
drivers/hwmon/nzxt-kraken2.c
@@
-161,13
+161,13
@@
static int kraken2_probe(struct hid_device *hdev,
ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
if (ret) {
hid_err(hdev, "hid hw start failed with %d\n", ret);
-
goto fail_and_stop
;
+
return ret
;
}
ret = hid_hw_open(hdev);
if (ret) {
hid_err(hdev, "hid hw open failed with %d\n", ret);
- goto fail_and_
close
;
+ goto fail_and_
stop
;
}
priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "kraken2",