From: akpm@linux-foundation.org Subject: [patch 2/3] dell-laptop: fix uninitialized/wrong return value Date: Tue, 12 May 2009 13:35:25 -0700 Message-ID: <200905122054.n4CKsfch001672@imap1.linux-foundation.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:42821 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751454AbZELU7Z (ORCPT ); Tue, 12 May 2009 16:59:25 -0400 Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, akpm@linux-foundation.org, ilpo.jarvinen@helsinki.fi, khali@linux-fr.org, len.brown@intel.com =46rom: Ilpo J=E4rvinen 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=E4rvinen Cc: Len Brown Cc: Jean Delvare Signed-off-by: Andrew Morton --- 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-uninitiali= zed-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) =20 if ((status & (1<<2|1<<8)) =3D=3D (1<<2|1<<8)) { wifi_rfkill =3D rfkill_allocate(NULL, RFKILL_TYPE_WLAN); - if (!wifi_rfkill) + if (!wifi_rfkill) { + ret =3D -ENOMEM; goto err_wifi; + } wifi_rfkill->name =3D "dell-wifi"; wifi_rfkill->toggle_radio =3D dell_wifi_set; wifi_rfkill->get_state =3D dell_wifi_get; @@ -261,8 +263,10 @@ static int dell_setup_rfkill(void) =20 if ((status & (1<<3|1<<9)) =3D=3D (1<<3|1<<9)) { bluetooth_rfkill =3D rfkill_allocate(NULL, RFKILL_TYPE_BLUETOOTH); - if (!bluetooth_rfkill) + if (!bluetooth_rfkill) { + ret =3D -ENOMEM; goto err_bluetooth; + } bluetooth_rfkill->name =3D "dell-bluetooth"; bluetooth_rfkill->toggle_radio =3D dell_bluetooth_set; bluetooth_rfkill->get_state =3D dell_bluetooth_get; @@ -273,8 +277,10 @@ static int dell_setup_rfkill(void) =20 if ((status & (1<<4|1<<10)) =3D=3D (1<<4|1<<10)) { wwan_rfkill =3D rfkill_allocate(NULL, RFKILL_TYPE_WWAN); - if (!wwan_rfkill) + if (!wwan_rfkill) { + ret =3D -ENOMEM; goto err_wwan; + } wwan_rfkill->name =3D "dell-wwan"; wwan_rfkill->toggle_radio =3D dell_wwan_set; wwan_rfkill->get_state =3D dell_wwan_get; _ -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html