The patch titled input drivers: handle sysfs errors has been added to the -mm tree. Its filename is input-drivers-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 drivers: 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/gameport/fm801-gp.c | 29 ++++++++++++---- drivers/input/mouse/logips2pp.c | 5 +- drivers/input/touchscreen/ads7846.c | 45 +++++++++++++++++--------- 3 files changed, 54 insertions(+), 25 deletions(-) diff -puN drivers/input/gameport/fm801-gp.c~input-drivers-handle-sysfs-errors drivers/input/gameport/fm801-gp.c --- a/drivers/input/gameport/fm801-gp.c~input-drivers-handle-sysfs-errors +++ a/drivers/input/gameport/fm801-gp.c @@ -82,17 +82,22 @@ static int __devinit fm801_gp_probe(stru { struct fm801_gp *gp; struct gameport *port; + int rc = -ENOMEM; gp = kzalloc(sizeof(struct fm801_gp), GFP_KERNEL); + if (!gp) { + printk(KERN_ERR "fm801-gp: Memory allocation failed\n"); + goto err_out; + } port = gameport_allocate_port(); - if (!gp || !port) { + if (!port) { printk(KERN_ERR "fm801-gp: Memory allocation failed\n"); - kfree(gp); - gameport_free_port(port); - return -ENOMEM; + goto err_out_gp; } - pci_enable_device(pci); + rc = pci_enable_device(pci); + if (rc) + goto err_out_port; port->open = fm801_gp_open; #ifdef HAVE_COOKED @@ -108,9 +113,8 @@ static int __devinit fm801_gp_probe(stru if (!gp->res_port) { printk(KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n", port->io, port->io + 0x0f); - gameport_free_port(port); - kfree(gp); - return -EBUSY; + rc = -EBUSY; + goto err_out_enabledev; } pci_set_drvdata(pci, gp); @@ -119,6 +123,15 @@ static int __devinit fm801_gp_probe(stru gameport_register_port(port); return 0; + +err_out_enabledev: + pci_disable_device(pci); +err_out_port: + gameport_free_port(port); +err_out_gp: + kfree(gp); +err_out: + return rc; } static void __devexit fm801_gp_remove(struct pci_dev *pci) diff -puN drivers/input/mouse/logips2pp.c~input-drivers-handle-sysfs-errors drivers/input/mouse/logips2pp.c --- a/drivers/input/mouse/logips2pp.c~input-drivers-handle-sysfs-errors +++ a/drivers/input/mouse/logips2pp.c @@ -393,8 +393,9 @@ int ps2pp_init(struct psmouse *psmouse, psmouse->set_resolution = ps2pp_set_resolution; psmouse->disconnect = ps2pp_disconnect; - device_create_file(&psmouse->ps2dev.serio->dev, - &psmouse_attr_smartscroll.dattr); + if (device_create_file(&psmouse->ps2dev.serio->dev, + &psmouse_attr_smartscroll.dattr)) + return -1; } } diff -puN drivers/input/touchscreen/ads7846.c~input-drivers-handle-sysfs-errors drivers/input/touchscreen/ads7846.c --- a/drivers/input/touchscreen/ads7846.c~input-drivers-handle-sysfs-errors +++ a/drivers/input/touchscreen/ads7846.c @@ -792,34 +792,49 @@ static int __devinit ads7846_probe(struc * use the other sensors a bit differently too */ if (ts->model == 7846) { - device_create_file(&spi->dev, &dev_attr_temp0); - device_create_file(&spi->dev, &dev_attr_temp1); + err = device_create_file(&spi->dev, &dev_attr_temp0); + if (err) + goto err_irq; + err = device_create_file(&spi->dev, &dev_attr_temp1); + if (err) + goto err_temp0; } - if (ts->model != 7845) - device_create_file(&spi->dev, &dev_attr_vbatt); - device_create_file(&spi->dev, &dev_attr_vaux); + if (ts->model != 7845) { + err = device_create_file(&spi->dev, &dev_attr_vbatt); + if (err) + goto err_temp1; + } + err = device_create_file(&spi->dev, &dev_attr_vaux); + if (err) goto err_vbatt; - device_create_file(&spi->dev, &dev_attr_pen_down); + err = device_create_file(&spi->dev, &dev_attr_pen_down); + if (err) goto err_vaux; - device_create_file(&spi->dev, &dev_attr_disable); + err = device_create_file(&spi->dev, &dev_attr_disable); + if (err) goto err_pen; err = input_register_device(input_dev); if (err) - goto err_remove_attr; + goto err_disable; return 0; - err_remove_attr: + err_disable: device_remove_file(&spi->dev, &dev_attr_disable); + err_pen: device_remove_file(&spi->dev, &dev_attr_pen_down); - if (ts->model == 7846) { - device_remove_file(&spi->dev, &dev_attr_temp1); - device_remove_file(&spi->dev, &dev_attr_temp0); - } + err_vaux: + device_remove_file(&spi->dev, &dev_attr_vaux); + err_vbatt: if (ts->model != 7845) device_remove_file(&spi->dev, &dev_attr_vbatt); - device_remove_file(&spi->dev, &dev_attr_vaux); - + err_temp1: + if (ts->model == 7846) + device_remove_file(&spi->dev, &dev_attr_temp1); + err_temp0: + if (ts->model == 7846) + device_remove_file(&spi->dev, &dev_attr_temp0); + err_irq: free_irq(spi->irq, ts); err_free_mem: input_free_device(input_dev); _ 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 cpufreq-handle-sysfs-errors.patch fs-partitions-check-add-sysfs-error-handling.patch drm-fix-error-returns-sysfs-error-handling.patch input-handle-sysfs-errors.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 drivers-dma-handle-sysfs-errors.patch atm-firestream-handle-thrown-error.patch r8169-driver-corega-support-patch.patch git-pciseg.patch watchdog-itco_wdt-fix-bug-related-to-gcc-uninit-warning.patch airo-suspend-fix.patch tpm-fix-error-handling.patch x86-microcode-handle-sysfs-error.patch firmware-dell_rbu-handle-sysfs-errors.patch firmware-dcdbas-fix-bug-in-error-cleanup.patch ipmi-handle-sysfs-errors.patch git-gccbug.patch drivers-ide-fix-error-return-bugs-interface.patch eisa-handle-sysfs-errors.patch firmware-efivars-handle-error.patch i2c-buses-scx200_acb-handle-pci-errors.patch input-drivers-handle-sysfs-errors.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