+ input-handle-sysfs-errors.patch added to -mm tree

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

 



The patch titled

     input: handle sysfs errors

has been added to the -mm tree.  Its filename is

     input-handle-sysfs-errors.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: input: handle sysfs errors
From: Jeff Garzik <jeff@xxxxxxxxxx>

Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx>
Cc: Dmitry Torokhov <dtor@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/input/keyboard/atkbd.c     |   25 ++++++++++++++++++++-----
 drivers/input/mouse/psmouse-base.c |   11 +++++++++--
 drivers/input/mouse/trackpoint.c   |    7 ++++++-
 3 files changed, 35 insertions(+), 8 deletions(-)

diff -puN drivers/input/keyboard/atkbd.c~input-handle-sysfs-errors drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c~input-handle-sysfs-errors
+++ a/drivers/input/keyboard/atkbd.c
@@ -962,11 +962,16 @@ static int atkbd_connect(struct serio *s
 	atkbd_set_keycode_table(atkbd);
 	atkbd_set_device_attrs(atkbd);
 
-	device_create_file(&serio->dev, &atkbd_attr_extra);
-	device_create_file(&serio->dev, &atkbd_attr_scroll);
-	device_create_file(&serio->dev, &atkbd_attr_set);
-	device_create_file(&serio->dev, &atkbd_attr_softrepeat);
-	device_create_file(&serio->dev, &atkbd_attr_softraw);
+	err = device_create_file(&serio->dev, &atkbd_attr_extra);
+	if (err) goto fail_serio;
+	err = device_create_file(&serio->dev, &atkbd_attr_scroll);
+	if (err) goto fail_extra;
+	err = device_create_file(&serio->dev, &atkbd_attr_set);
+	if (err) goto fail_scroll;
+	err = device_create_file(&serio->dev, &atkbd_attr_softrepeat);
+	if (err) goto fail_set;
+	err = device_create_file(&serio->dev, &atkbd_attr_softraw);
+	if (err) goto fail_softrep;
 
 	atkbd_enable(atkbd);
 
@@ -974,6 +979,16 @@ static int atkbd_connect(struct serio *s
 
 	return 0;
 
+ fail_softrep:
+	device_remove_file(&serio->dev, &atkbd_attr_softrepeat);
+ fail_set:
+	device_remove_file(&serio->dev, &atkbd_attr_set);
+ fail_scroll:
+	device_remove_file(&serio->dev, &atkbd_attr_scroll);
+ fail_extra:
+	device_remove_file(&serio->dev, &atkbd_attr_extra);
+ fail_serio:
+	serio_close(serio);
  fail:	serio_set_drvdata(serio, NULL);
 	input_free_device(dev);
 	kfree(atkbd);
diff -puN drivers/input/mouse/psmouse-base.c~input-handle-sysfs-errors drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c~input-handle-sysfs-errors
+++ a/drivers/input/mouse/psmouse-base.c
@@ -1167,11 +1167,13 @@ static int psmouse_connect(struct serio 
 
 	input_register_device(psmouse->dev);
 
+	retval = sysfs_create_group(&serio->dev.kobj, &psmouse_attribute_group);
+	if (retval)
+		goto err_out;
+
 	if (parent && parent->pt_activate)
 		parent->pt_activate(parent);
 
-	sysfs_create_group(&serio->dev.kobj, &psmouse_attribute_group);
-
 	psmouse_activate(psmouse);
 
 	retval = 0;
@@ -1189,6 +1191,11 @@ out:
 
 	mutex_unlock(&psmouse_mutex);
 	return retval;
+err_out:
+	input_unregister_device(psmouse->dev);
+	psmouse_set_state(psmouse, PSMOUSE_IGNORE);
+	serio_close(serio);
+	goto out;
 }
 
 
diff -puN drivers/input/mouse/trackpoint.c~input-handle-sysfs-errors drivers/input/mouse/trackpoint.c
--- a/drivers/input/mouse/trackpoint.c~input-handle-sysfs-errors
+++ a/drivers/input/mouse/trackpoint.c
@@ -293,6 +293,7 @@ int trackpoint_detect(struct psmouse *ps
 	struct ps2dev *ps2dev = &psmouse->ps2dev;
 	unsigned char firmware_id;
 	unsigned char button_info;
+	int rc;
 
 	if (trackpoint_start_protocol(psmouse, &firmware_id))
 		return -1;
@@ -318,7 +319,11 @@ int trackpoint_detect(struct psmouse *ps
 	trackpoint_defaults(priv);
 	trackpoint_sync(psmouse);
 
-	sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group);
+	rc=sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group);
+	if (rc) {
+		kfree(priv);
+		return -1;
+	}
 
 	printk(KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n",
 		firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f);
_

Patches currently in -mm which might be from jeff@xxxxxxxxxx are

origin.patch
fix-up-a-multitude-of-acpi-compiler-warnings-on-x86_64.patch
fs-partitions-check-add-sysfs-error-handling.patch
drm-fix-error-returns-sysfs-error-handling.patch
git-libata-all.patch
ata-must-depend-on-block.patch
pci_module_init-conversion-for-pata_pdc2027x.patch
libata-return-sense-data-in-hdio_drive_cmd-ioctl.patch
libata-return-sense-data-in-hdio_drive_cmd-ioctl-tidy.patch
via-pata-controller-xfer-fixes.patch
ahci-ati-sb600-sata-support-for-various-modes.patch
git-mtd.patch
git-netdev-all.patch
libphy-dont-do-that.patch
update-smc91x-driver-with-arm-versatile-board-info.patch
b44-fix-eeprom-endianess-issue.patch
forcedeth-power-management-support.patch
forcedeth-power-management-support-tidy.patch
remove-unnecessary-check-in-drivers-net-depcac.patch
8139too-force-media-setting-fix.patch
ibmveth-irq-fix.patch
tulip-fix-shutdown-dma-irq-race.patch
r8169-driver-corega-support-patch.patch
git-pciseg.patch
airo-suspend-fix.patch
tpm-fix-error-handling.patch
x86-microcode-handle-sysfs-error.patch
git-gccbug.patch
input-handle-sysfs-errors.patch
firmware-dell_rbu-handle-sysfs-errors.patch
firmware-dcdbas-fix-bug-in-error-cleanup.patch
drivers-dma-handle-sysfs-errors.patch
cpufreq-handle-sysfs-errors.patch
ipmi-handle-sysfs-errors.patch
atm-firestream-handle-thrown-error.patch
watchdog-itco_wdt-fix-bug-related-to-gcc-uninit-warning.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