- input-change-to-gfp_kernel-for-serio_register_driver-event-allocation.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     input: change to GFP_KERNEL for SERIO_REGISTER_DRIVER event allocation
has been removed from the -mm tree.  Its filename was
     input-change-to-gfp_kernel-for-serio_register_driver-event-allocation.patch

This patch was dropped because your earlier patch got merged, but everything got changed, breaking this patch

------------------------------------------------------
Subject: input: change to GFP_KERNEL for SERIO_REGISTER_DRIVER event allocation
From: Akinobu Mita <akinobu.mita@xxxxxxxxx>

This patch changes allocation from GFP_ATOMIC to GFP_KERNEL for
SERIO_REGISTER_DRIVER events to make it more robust.

Cc: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/input/serio/serio.c |   29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff -puN drivers/input/serio/serio.c~input-change-to-gfp_kernel-for-serio_register_driver-event-allocation drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c~input-change-to-gfp_kernel-for-serio_register_driver-event-allocation
+++ a/drivers/input/serio/serio.c
@@ -187,12 +187,15 @@ static DECLARE_WAIT_QUEUE_HEAD(serio_wai
 static struct task_struct *serio_task;
 
 static int serio_queue_event(void *object, struct module *owner,
-			     enum serio_event_type event_type)
+			     enum serio_event_type event_type, gfp_t gfp_flags)
 {
 	unsigned long flags;
 	struct serio_event *event;
+	struct serio_event *new_event;
 	int err = 0;
 
+	new_event = kmalloc(sizeof(struct serio_event), gfp_flags);
+
 	spin_lock_irqsave(&serio_event_lock, flags);
 
 	/*
@@ -204,25 +207,27 @@ static int serio_queue_event(void *objec
 	 */
 	list_for_each_entry_reverse(event, &serio_event_list, node) {
 		if (event->object == object) {
-			if (event->type == event_type)
+			if (event->type == event_type) {
+				kfree(new_event);
 				goto out;
+			}
 			break;
 		}
 	}
 
-	if ((event = kmalloc(sizeof(struct serio_event), GFP_ATOMIC))) {
+	if (new_event) {
 		if (!try_module_get(owner)) {
 			err = -EINVAL;
 			printk(KERN_WARNING "serio: Can't get module reference, dropping event %d\n", event_type);
-			kfree(event);
+			kfree(new_event);
 			goto out;
 		}
 
-		event->type = event_type;
-		event->object = object;
-		event->owner = owner;
+		new_event->type = event_type;
+		new_event->object = object;
+		new_event->owner = owner;
 
-		list_add_tail(&event->node, &serio_event_list);
+		list_add_tail(&new_event->node, &serio_event_list);
 		wake_up(&serio_wait);
 	} else {
 		err = -ENOMEM;
@@ -670,12 +675,12 @@ static void serio_disconnect_port(struct
 
 void serio_rescan(struct serio *serio)
 {
-	serio_queue_event(serio, NULL, SERIO_RESCAN);
+	serio_queue_event(serio, NULL, SERIO_RESCAN, GFP_ATOMIC);
 }
 
 void serio_reconnect(struct serio *serio)
 {
-	serio_queue_event(serio, NULL, SERIO_RECONNECT);
+	serio_queue_event(serio, NULL, SERIO_RECONNECT, GFP_ATOMIC);
 }
 
 /*
@@ -685,7 +690,7 @@ void serio_reconnect(struct serio *serio
 void __serio_register_port(struct serio *serio, struct module *owner)
 {
 	serio_init_port(serio);
-	serio_queue_event(serio, owner, SERIO_REGISTER_PORT);
+	serio_queue_event(serio, owner, SERIO_REGISTER_PORT, GFP_ATOMIC);
 }
 
 /*
@@ -787,7 +792,7 @@ int __serio_register_driver(struct serio
 {
 	drv->driver.bus = &serio_bus;
 
-	return serio_queue_event(drv, owner, SERIO_REGISTER_DRIVER);
+	return serio_queue_event(drv, owner, SERIO_REGISTER_DRIVER, GFP_KERNEL);
 }
 
 void serio_unregister_driver(struct serio_driver *drv)
_

Patches currently in -mm which might be from akinobu.mita@xxxxxxxxx are

origin.patch
fix-copy_process-error-check.patch
tlclk-fix-platform_device_register_simple-error-check.patch
acpi-fix-single-linked-list-manipulation.patch
acpi-processor-prevent-loading-module-on-failures.patch
git-alsa.patch
drm-fix-return-value-check.patch
git-input.patch
input-check-whether-serio-dirver-registration-is-completed.patch
input-change-to-gfp_kernel-for-serio_register_driver-event-allocation.patch
ata-fix-platform_device_register_simple-error-check.patch
git-mtd.patch
gss_spkm3-fix-error-handling-in-module-init.patch
auth_gss-unregister-gss_domain-when-unloading-module.patch
auth_gss-unregister-gss_domain-when-unloading-module-fix.patch
git-pcmcia.patch
git-watchdog.patch
paride-return-proper-error-code.patch
bit-revese-library.patch
crc32-replace-bitreverse-by-bitrev32.patch
video-use-bitrev8.patch
net-use-bitrev8.patch
net-use-bitrev8-tidy.patch
isdn-hisax-use-bitrev8.patch
atm-ambassador-use-bitrev8.patch
isdn-gigaset-use-bitrev8.patch
isdn-fix-missing-unregister_capi_driver.patch
fault-injection-documentation-and-scripts.patch
fault-injection-capabilities-infrastructure.patch
fault-injection-capabilities-infrastructure-tidy.patch
fault-injection-capabilities-infrastructure-tweaks.patch
fault-injection-capability-for-kmalloc.patch
fault-injection-capability-for-kmalloc-failslab-remove-__gfp_highmem-filtering.patch
fault-injection-capability-for-alloc_pages.patch
fault-injection-capability-for-disk-io.patch
fault-injection-process-filtering-for-fault-injection-capabilities.patch
fault-injection-stacktrace-filtering.patch
fault-injection-stacktrace-filtering-reject-failure-if-any-caller-lies-within-specified-range.patch
fault-injection-Kconfig-cleanup.patch
fault-injection-stacktrace-filtering-kconfig-fix.patch
fault-injection-Kconfig-cleanup-config_fault_injection-help-text.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux