Skip to contentSkip to conversation

x86 platform drivers, wmi: Remove needless dmi MODULE_ALIAS

PATCH Applied Thomas Renninger 5 participants 8 messages Dec 18, 2009 – Dec 24, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 x86 platform drivers, wmi: Remove needless dmi MODULE_ALIAS

wmi autoloading came in, so the dmi matching for autoloading is not needed anymore.

CC Carlos Corbacho <[email protected]>
CC Matthew Garrett <[email protected]>
CC Len Brown <[email protected]>
---
 drivers/platform/x86/acer-wmi.c |    3 ---
 drivers/platform/x86/msi-wmi.c  |   10 ----------
 2 files changed, 0 insertions(+), 13 deletions(-)
drivers/platform/x86/acer-wmi.c +0 -3
index 454970d..07d14df 100644
@@ -96,9 +96,6 @@ struct acer_quirks {
 MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB");
 MODULE_ALIAS("wmi:6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3");
 
-/* Temporary workaround until the WMI sysfs interface goes in */
-MODULE_ALIAS("dmi:*:*Acer*:*:");
-
 /*
  * Interface capability flags
  */
drivers/platform/x86/msi-wmi.c +0 -10
index 0c8fe14..7f77f90 100644
@@ -34,16 +34,6 @@ MODULE_LICENSE("GPL");
 MODULE_ALIAS("wmi:551A1F84-FBDD-4125-91DB-3EA8F44F1D45");
 MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2");
 
-/* Temporary workaround until the WMI sysfs interface goes in
-		{ "svn", DMI_SYS_VENDOR },
-		{ "pn",  DMI_PRODUCT_NAME },
-		{ "pvr", DMI_PRODUCT_VERSION },
-		{ "rvn", DMI_BOARD_VENDOR },
-		{ "rn",  DMI_BOARD_NAME },
-*/
-
-MODULE_ALIAS("dmi:*:svnMICRO-STARINTERNATIONAL*:pnMS-6638:*");
-
 #define DRV_NAME "msi-wmi"
 #define DRV_PFX DRV_NAME ": "
 
Signature · 1 line
1.6.3
#1 lore raw

PATCH 2/2 x86 platform drivers, hp-wmi: Fix two memleaks

CC Carlos Corbacho <[email protected]>
CC Matthew Garrett <[email protected]>
CC Len Brown <[email protected]>
---
 drivers/platform/x86/hp-wmi.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/platform/x86/hp-wmi.c +9 -1
index 63c3e65..01a0913 100644
@@ -134,10 +134,15 @@ static int hp_wmi_perform_query(int query, int write, int value)
 
 	obj = output.pointer;
 
-	if (!obj || obj->type != ACPI_TYPE_BUFFER)
+	if (!obj)
 		return -EINVAL;
+	else if (obj->type != ACPI_TYPE_BUFFER) {
+		kfree(obj);
+		return -EINVAL;
+	}
 
 	bios_return = *((struct bios_return *)obj->buffer.pointer);
+	kfree(obj);
 	if (bios_return.return_code > 0)
 		return bios_return.return_code * -1;
 	else
@@ -340,10 +345,13 @@ static void hp_wmi_notify(u32 value, void *context)
 
 	if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length != 8) {
 		printk(KERN_INFO "HP WMI: Unknown response received\n");
+		if (obj)
+			kfree(obj);
 		return;
 	}
 
 	eventcode = *((u8 *) obj->buffer.pointer);
+	kfree(obj);
 	if (eventcode == 0x4)
 		eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0,
 						0);
Signature · 1 line
1.6.3
reviewer
#2 lore raw

Re: [PATCH 2/2] x86 platform drivers, hp-wmi: Fix two memleaks

thanks,
Len Brown, Intel Open Source Technology Center

Quoted 32 lines · Thomas Renninger
CC Carlos Corbacho <[email protected]>
CC Matthew Garrett <[email protected]>
CC Len Brown <[email protected]>
---
 drivers/platform/x86/hp-wmi.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/platform/x86/hp-wmi.c +6 -1
index 63c3e65..01a0913 100644
@@ -134,10 +134,15 @@ static int hp_wmi_perform_query(int query, int write, int value)
 
 	obj = output.pointer;
 
-	if (!obj || obj->type != ACPI_TYPE_BUFFER)
+	if (!obj)
 		return -EINVAL;
+	else if (obj->type != ACPI_TYPE_BUFFER) {
+		kfree(obj);
+		return -EINVAL;
+	}
 
 	bios_return = *((struct bios_return *)obj->buffer.pointer);
+	kfree(obj);
 	if (bios_return.return_code > 0)
 		return bios_return.return_code * -1;
 	else

drivers/platform/x86/hp-wmi.c static void hp_wmi_notify(u32 value, void *context) · line 349

Quoted 5 lines
drivers/platform/x86/hp-wmi.c +2 -0
@@ -340,10 +345,13 @@ static void hp_wmi_notify(u32 value, void *context)
 
 	if (!obj || obj->type != ACPI_TYPE_BUFFER || obj->buffer.length != 8) {
 		printk(KERN_INFO "HP WMI: Unknown response received\n");
+		if (obj)
+			kfree(obj);

WARNING: kfree(NULL) is safe this check is probably not required #44: FILE: drivers/platform/x86/hp-wmi.c:349:
+ if (obj)
+ kfree(obj);

so I deleted "if(obj)" above and applied the patch.

thanks,
Len Brown, Intel Open Source Technology Center

Quoted 9 lines
drivers/platform/x86/hp-wmi.c +1 -0
 		return;
 	}
 
 	eventcode = *((u8 *) obj->buffer.pointer);
+	kfree(obj);
 	if (eventcode == 0x4)
 		eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0,
 						0);
Acked-by on v1 1/2
#3 lore raw
In reply to Thomas Renninger
Quoted 9 lines · On Friday 18 December 2009 14:29:22 Thomas Renninger wrote:

wmi autoloading came in, so the dmi matching for autoloading is not needed anymore.

CC Carlos Corbacho <[email protected]>
CC Matthew Garrett <[email protected]>
CC Len Brown <[email protected]>

For acer-wmi:

Signature · 3 lines
E-Mail: [email protected]
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
Acked-by on v1 1/2
#4 lore raw
In reply to Thomas Renninger
Quoted 3 lines · Thomas Renninger

wmi autoloading came in, so the dmi matching for autoloading is not needed anymore.

For this to work properly you need to have wmi built in your kernel, or have your distribution load the wmi module. Maybe there should be some kind of auto-loading for the wmi subsystem (acpi-based?).

Anyway, that's out of the scope of this patch, which was the plan all-along.

FWIW, and for msi-wmi :

Regards,

Anisse

#5 lore raw
Quoted 3 lines · Anisse Astier

For this to work properly you need to have wmi built in your kernel, or have your distribution load the wmi module. Maybe there should be some kind of auto-loading for the wmi subsystem (acpi-based?).

[mjg59@2530p ~]$ modinfo wmi | grep alias

alias:          acpi*:pnp0c14:*
alias:          acpi*:PNP0C14:*

Should work already.

Signature · 1 line
Matthew Garrett | [email protected]
#6 lore raw
Quoted 6 lines · Matthew Garrett
Quoted 3 lines · Anisse Astier

For this to work properly you need to have wmi built in your kernel, or have your distribution load the wmi module. Maybe there should be some kind of auto-loading for the wmi subsystem (acpi-based?).

Quoted 6 lines

[mjg59@2530p ~]$ modinfo wmi | grep alias
alias:          acpi*:pnp0c14:*
alias:          acpi*:PNP0C14:*

Should work already.

Indeed, it does, my mistake.

I completely forgot about those lines. In fact, the reason I started hacking on msi-wmi (the previous driver), was because it didn't have a proper auto-loading, and thus we packaged it out of kernel tree.

It was using dmi auto-loading with those standard wmi strings (pnp0c14).

Regards,

--
Anisse
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html