Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel
[patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference
 

Index | Next | Previous | View Flat


gorcunov at gmail

Apr 16, 2008, 10:44 AM


Views: 394
Permalink
[patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference

Fix potential NULL pointer dereference if kstrdup failed

Signed-off-by: Cyrill Gorcunov <gorcunov[at]gmail.com>

---

Index: linux-2.6.git/drivers/misc/thinkpad_acpi.c
===================================================================
--- linux-2.6.git.orig/drivers/misc/thinkpad_acpi.c 2008-04-16 20:35:34.000000000 +0400
+++ linux-2.6.git/drivers/misc/thinkpad_acpi.c 2008-04-16 20:36:38.000000000 +0400
@@ -5826,7 +5826,7 @@ static void __init get_thinkpad_model_da

tp->model_str = kstrdup(dmi_get_system_info(DMI_PRODUCT_VERSION),
GFP_KERNEL);
- if (strnicmp(tp->model_str, "ThinkPad", 8) != 0) {
+ if (tp->model_str && strnicmp(tp->model_str, "ThinkPad", 8) != 0) {
kfree(tp->model_str);
tp->model_str = NULL;
}

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Subject User Time
[patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference gorcunov at gmail Apr 16, 2008, 10:44 AM
    Re: [patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference hmh at hmh Apr 16, 2008, 1:52 PM
    Re: [patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference pavel at ucw Apr 18, 2008, 5:41 AM
        Re: [patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference gorcunov at gmail Apr 18, 2008, 5:55 AM
        Re: [patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference gorcunov at gmail Apr 18, 2008, 6:07 AM
            Re: [patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference hmh at hmh Apr 18, 2008, 9:10 PM
        Re: [patch 3/3] ThinkPad ACPI: fix possible NULL pointer dereference gorcunov at gmail Apr 18, 2008, 6:53 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.