From: Kirill Tkhai <tkhai@yandex.ru>
To: platform-driver-x86@vger.kernel.org
Cc: Garrett Matthew <matthew.garrett@nebula.com>
Subject: [PATCH]hp_wmi: Fix unregister order in hp_wmi_rfkill_setup()
Date: Mon, 29 Jul 2013 17:34:37 +0400 [thread overview]
Message-ID: <3838581375104877@web14g.yandex.ru> (raw)
Register order is:
wifi
bluetooth
wwan
gps
So unregister order must be:
gps
wwan
bluetiith
wifi
But currently gps and wwan are swapped. Fix that.
Also fix goto links.
Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
CC: Matthew Garrett <matthew.garrett@nebula.com>
---
drivers/platform/x86/hp-wmi.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 97bb05e..aa5d0de 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -739,7 +739,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
(void *) HPWMI_WWAN);
if (!wwan_rfkill) {
err = -ENOMEM;
- goto register_gps_error;
+ goto register_bluetooth_error;
}
rfkill_init_sw_state(wwan_rfkill,
hp_wmi_get_sw_state(HPWMI_WWAN));
@@ -747,7 +747,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
hp_wmi_get_hw_state(HPWMI_WWAN));
err = rfkill_register(wwan_rfkill);
if (err)
- goto register_wwan_err;
+ goto register_wwan_error;
}
if (wireless & 0x8) {
@@ -757,7 +757,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
(void *) HPWMI_GPS);
if (!gps_rfkill) {
err = -ENOMEM;
- goto register_bluetooth_error;
+ goto register_wwan_error;
}
rfkill_init_sw_state(gps_rfkill,
hp_wmi_get_sw_state(HPWMI_GPS));
@@ -769,16 +769,16 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
}
return 0;
-register_wwan_err:
- rfkill_destroy(wwan_rfkill);
- wwan_rfkill = NULL;
- if (gps_rfkill)
- rfkill_unregister(gps_rfkill);
register_gps_error:
rfkill_destroy(gps_rfkill);
gps_rfkill = NULL;
if (bluetooth_rfkill)
rfkill_unregister(bluetooth_rfkill);
+register_wwan_error:
+ rfkill_destroy(wwan_rfkill);
+ wwan_rfkill = NULL;
+ if (gps_rfkill)
+ rfkill_unregister(gps_rfkill);
register_bluetooth_error:
rfkill_destroy(bluetooth_rfkill);
bluetooth_rfkill = NULL;
next reply other threads:[~2013-07-29 13:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 13:34 Kirill Tkhai [this message]
2013-09-03 12:14 ` [PATCH]hp_wmi: Fix unregister order in hp_wmi_rfkill_setup() Matthew Garrett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3838581375104877@web14g.yandex.ru \
--to=tkhai@yandex.ru \
--cc=matthew.garrett@nebula.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox