The patch titled PNP: handle sysfs errors has been added to the -mm tree. Its filename is pnp-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: PNP: handle sysfs errors From: Jeff Garzik <jeff@xxxxxxxxxx> Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx> Cc: Adam Belay <ambx1@xxxxxxxxxx> Cc: Bjorn Helgaas <bjorn.helgaas@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/pnp/card.c | 30 +++++++++++++++++++++--------- drivers/pnp/interface.c | 17 ++++++++++++++--- 2 files changed, 35 insertions(+), 12 deletions(-) diff -puN drivers/pnp/card.c~pnp-handle-sysfs-errors drivers/pnp/card.c --- a/drivers/pnp/card.c~pnp-handle-sysfs-errors +++ a/drivers/pnp/card.c @@ -164,9 +164,17 @@ static DEVICE_ATTR(card_id,S_IRUGO,pnp_s static int pnp_interface_attach_card(struct pnp_card *card) { - device_create_file(&card->dev,&dev_attr_name); - device_create_file(&card->dev,&dev_attr_card_id); + int rc = device_create_file(&card->dev,&dev_attr_name); + if (rc) return rc; + + rc = device_create_file(&card->dev,&dev_attr_card_id); + if (rc) goto err_name; + return 0; + +err_name: + device_remove_file(&card->dev,&dev_attr_name); + return rc; } /** @@ -306,16 +314,20 @@ found: down_write(&dev->dev.bus->subsys.rwsem); dev->card_link = clink; dev->dev.driver = &drv->link.driver; - if (pnp_bus_type.probe(&dev->dev)) { - dev->dev.driver = NULL; - dev->card_link = NULL; - up_write(&dev->dev.bus->subsys.rwsem); - return NULL; - } - device_bind_driver(&dev->dev); + if (pnp_bus_type.probe(&dev->dev)) + goto err_out; + if (device_bind_driver(&dev->dev)) + goto err_out; + up_write(&dev->dev.bus->subsys.rwsem); return dev; + +err_out: + dev->dev.driver = NULL; + dev->card_link = NULL; + up_write(&dev->dev.bus->subsys.rwsem); + return NULL; } /** diff -puN drivers/pnp/interface.c~pnp-handle-sysfs-errors drivers/pnp/interface.c --- a/drivers/pnp/interface.c~pnp-handle-sysfs-errors +++ a/drivers/pnp/interface.c @@ -461,8 +461,19 @@ static DEVICE_ATTR(id,S_IRUGO,pnp_show_c int pnp_interface_attach_device(struct pnp_dev *dev) { - device_create_file(&dev->dev,&dev_attr_options); - device_create_file(&dev->dev,&dev_attr_resources); - device_create_file(&dev->dev,&dev_attr_id); + int rc = device_create_file(&dev->dev,&dev_attr_options); + if (rc) goto err; + rc = device_create_file(&dev->dev,&dev_attr_resources); + if (rc) goto err_opt; + rc = device_create_file(&dev->dev,&dev_attr_id); + if (rc) goto err_res; + return 0; + +err_res: + device_remove_file(&dev->dev,&dev_attr_resources); +err_opt: + device_remove_file(&dev->dev,&dev_attr_options); +err: + return rc; } _ Patches currently in -mm which might be from jeff@xxxxxxxxxx are origin.patch tpm-fix-error-handling.patch x86-microcode-handle-sysfs-error.patch firmware-dell_rbu-handle-sysfs-errors.patch ipmi-handle-sysfs-errors.patch eisa-handle-sysfs-errors.patch firmware-efivars-handle-error.patch drivers-mca-handle-sysfs-errors.patch isdn-several-minor-fixes.patch fix-up-a-multitude-of-acpi-compiler-warnings-on-x86_64.patch cpufreq-handle-sysfs-errors.patch drm-fix-error-returns-sysfs-error-handling.patch git-dvb.patch drivers-media-video-handle-sysfs-errors.patch i2c-buses-scx200_acb-handle-pci-errors.patch input-handle-sysfs-errors.patch input-drivers-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 via-pata-controller-xfer-fixes.patch ahci-ati-sb600-sata-support-for-various-modes.patch drivers-mmcmisc-handle-pci-errors-on-resume.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 remove-unnecessary-check-in-drivers-net-depcac.patch 8139too-force-media-setting-fix.patch ibmveth-irq-fix.patch ehea-firmware-interface-based-on-anton-blanchards-new-hvcall-interface.patch tulip-fix-shutdown-dma-irq-race.patch drivers-dma-handle-sysfs-errors.patch atm-firestream-handle-thrown-error.patch wan-pc300-handle-propagate-minor-errors.patch pcmcia-handle-sysfs-pci-errors.patch r8169-driver-corega-support-patch.patch git-pciseg.patch scsi-minor-bug-fixes-and-cleanups.patch mpt-fusion-handle-pci-layer-error-on-resume.patch watchdog-itco_wdt-fix-bug-related-to-gcc-uninit-warning.patch airo-suspend-fix.patch drivers-led-handle-sysfs-errors.patch i2o-handle-a-few-sysfs-errors.patch fs-partitions-check-add-sysfs-error-handling.patch rtc-fix-printk-of-64-bit-res-on-32-bit-platform.patch i2o-more-error-checking.patch pnp-handle-sysfs-errors.patch isdn-fix-drivers-by-handling-errors-thrown-by-readstat.patch isdn-check-for-userspace-copy-faults.patch atyfb-rivafb-minor-fixes.patch md-conditionalize-some-code.patch git-gccbug.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