From: Greg Kroah-Hartman Date: Tue, 7 Aug 2007 15:55:25 +0000 (-0700) Subject: another 2.6.22 patch X-Git-Tag: v2.6.21.7~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc2ee2fff7d5fc17f488f5c4cd4ccc7b48f211fa;p=thirdparty%2Fkernel%2Fstable-queue.git another 2.6.22 patch --- diff --git a/queue-2.6.22/acpi-dock-fix-opps-after-dock-driver-fails-to-initialize.patch b/queue-2.6.22/acpi-dock-fix-opps-after-dock-driver-fails-to-initialize.patch new file mode 100644 index 00000000000..a7159c07d32 --- /dev/null +++ b/queue-2.6.22/acpi-dock-fix-opps-after-dock-driver-fails-to-initialize.patch @@ -0,0 +1,86 @@ +From cebbert@redhat.com Tue Aug 7 08:34:37 2007 +From: Chuck Ebbert +Date: Tue, 07 Aug 2007 11:27:41 -0400 +Subject: ACPI: dock: fix opps after dock driver fails to initialize +To: linux-stable +Cc: "Brown, Len" +Message-ID: <46B88F6D.8070903@redhat.com> + + +From: Chuck Ebbert + +ACPI: dock: fix opps after dock driver fails to initialize + +The driver tests the dock_station pointer for nonnull +to check whether it has initialized properly. But in +some cases dock_station will be non-null after being +freed when driver init fails. Fix by zeroing the +pointer after freeing. + +Signed-off-by: Chuck Ebbert +Signed-off-by: Kristen Carlson Accardi +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/dock.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/acpi/dock.c ++++ b/drivers/acpi/dock.c +@@ -716,6 +716,7 @@ static int dock_add(acpi_handle handle) + if (ret) { + printk(KERN_ERR PREFIX "Error %d registering dock device\n", ret); + kfree(dock_station); ++ dock_station = NULL; + return ret; + } + ret = device_create_file(&dock_device.dev, &dev_attr_docked); +@@ -723,6 +724,7 @@ static int dock_add(acpi_handle handle) + printk("Error %d adding sysfs file\n", ret); + platform_device_unregister(&dock_device); + kfree(dock_station); ++ dock_station = NULL; + return ret; + } + ret = device_create_file(&dock_device.dev, &dev_attr_undock); +@@ -731,6 +733,7 @@ static int dock_add(acpi_handle handle) + device_remove_file(&dock_device.dev, &dev_attr_docked); + platform_device_unregister(&dock_device); + kfree(dock_station); ++ dock_station = NULL; + return ret; + } + ret = device_create_file(&dock_device.dev, &dev_attr_uid); +@@ -738,6 +741,7 @@ static int dock_add(acpi_handle handle) + printk("Error %d adding sysfs file\n", ret); + platform_device_unregister(&dock_device); + kfree(dock_station); ++ dock_station = NULL; + return ret; + } + +@@ -750,6 +754,7 @@ static int dock_add(acpi_handle handle) + dd = alloc_dock_dependent_device(handle); + if (!dd) { + kfree(dock_station); ++ dock_station = NULL; + ret = -ENOMEM; + goto dock_add_err_unregister; + } +@@ -777,6 +782,7 @@ dock_add_err_unregister: + device_remove_file(&dock_device.dev, &dev_attr_undock); + platform_device_unregister(&dock_device); + kfree(dock_station); ++ dock_station = NULL; + return ret; + } + +@@ -810,6 +816,7 @@ static int dock_remove(void) + + /* free dock station memory */ + kfree(dock_station); ++ dock_station = NULL; + return 0; + } + diff --git a/queue-2.6.22/series b/queue-2.6.22/series index c6522e7d4b2..63e29895106 100644 --- a/queue-2.6.22/series +++ b/queue-2.6.22/series @@ -72,3 +72,4 @@ dm-io-fix-panic-on-large-request-2.patch dm-snapshot-permit-invalid-activation.patch dm-disable-barriers.patch cr_backlight_probe-allocates-too-little-storage-for-struct-cr_panel.patch +acpi-dock-fix-opps-after-dock-driver-fails-to-initialize.patch