All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2/3] dell-laptop: fix uninitialized/wrong return value
@ 2009-05-12 20:35 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2009-05-12 20:35 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, akpm, ilpo.jarvinen, khali, len.brown

From: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

Seriously, a helper would be much nicer here instead of all that copy
paste but I leave that as future work item.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Len Brown <len.brown@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/platform/x86/dell-laptop.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff -puN drivers/platform/x86/dell-laptop.c~dell-laptop-fix-uninitialized-wrong-return-value drivers/platform/x86/dell-laptop.c
--- a/drivers/platform/x86/dell-laptop.c~dell-laptop-fix-uninitialized-wrong-return-value
+++ a/drivers/platform/x86/dell-laptop.c
@@ -249,8 +249,10 @@ static int dell_setup_rfkill(void)
 
 	if ((status & (1<<2|1<<8)) == (1<<2|1<<8)) {
 		wifi_rfkill = rfkill_allocate(NULL, RFKILL_TYPE_WLAN);
-		if (!wifi_rfkill)
+		if (!wifi_rfkill) {
+			ret = -ENOMEM;
 			goto err_wifi;
+		}
 		wifi_rfkill->name = "dell-wifi";
 		wifi_rfkill->toggle_radio = dell_wifi_set;
 		wifi_rfkill->get_state = dell_wifi_get;
@@ -261,8 +263,10 @@ static int dell_setup_rfkill(void)
 
 	if ((status & (1<<3|1<<9)) == (1<<3|1<<9)) {
 		bluetooth_rfkill = rfkill_allocate(NULL, RFKILL_TYPE_BLUETOOTH);
-		if (!bluetooth_rfkill)
+		if (!bluetooth_rfkill) {
+			ret = -ENOMEM;
 			goto err_bluetooth;
+		}
 		bluetooth_rfkill->name = "dell-bluetooth";
 		bluetooth_rfkill->toggle_radio = dell_bluetooth_set;
 		bluetooth_rfkill->get_state = dell_bluetooth_get;
@@ -273,8 +277,10 @@ static int dell_setup_rfkill(void)
 
 	if ((status & (1<<4|1<<10)) == (1<<4|1<<10)) {
 		wwan_rfkill = rfkill_allocate(NULL, RFKILL_TYPE_WWAN);
-		if (!wwan_rfkill)
+		if (!wwan_rfkill) {
+			ret = -ENOMEM;
 			goto err_wwan;
+		}
 		wwan_rfkill->name = "dell-wwan";
 		wwan_rfkill->toggle_radio = dell_wwan_set;
 		wwan_rfkill->get_state = dell_wwan_get;
_
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-12 20:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 20:35 [patch 2/3] dell-laptop: fix uninitialized/wrong return value akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.