The patch titled drivers/mca: handle sysfs errors has been added to the -mm tree. Its filename is drivers-mca-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: drivers/mca: handle sysfs errors From: Jeff Garzik <jeff@xxxxxxxxxx> Also includes a kmalloc->kzalloc cleanup. Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx> Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/mca/mca-bus.c | 30 ++++++++++++++++++++++-------- 1 files changed, 22 insertions(+), 8 deletions(-) diff -puN drivers/mca/mca-bus.c~drivers-mca-handle-sysfs-errors drivers/mca/mca-bus.c --- a/drivers/mca/mca-bus.c~drivers-mca-handle-sysfs-errors +++ a/drivers/mca/mca-bus.c @@ -100,6 +100,7 @@ static DEVICE_ATTR(pos, S_IRUGO, mca_sho int __init mca_register_device(int bus, struct mca_device *mca_dev) { struct mca_bus *mca_bus = mca_root_busses[bus]; + int rc; mca_dev->dev.parent = &mca_bus->dev; mca_dev->dev.bus = &mca_bus_type; @@ -108,13 +109,23 @@ int __init mca_register_device(int bus, mca_dev->dev.dma_mask = &mca_dev->dma_mask; mca_dev->dev.coherent_dma_mask = mca_dev->dma_mask; - if (device_register(&mca_dev->dev)) - return 0; - - device_create_file(&mca_dev->dev, &dev_attr_id); - device_create_file(&mca_dev->dev, &dev_attr_pos); + rc = device_register(&mca_dev->dev); + if (rc) + goto err_out; + + rc = device_create_file(&mca_dev->dev, &dev_attr_id); + if (rc) goto err_out_devreg; + rc = device_create_file(&mca_dev->dev, &dev_attr_pos); + if (rc) goto err_out_id; return 1; + +err_out_id: + device_remove_file(&mca_dev->dev, &dev_attr_id); +err_out_devreg: + device_unregister(&mca_dev->dev); +err_out: + return 0; } /* */ @@ -130,13 +141,16 @@ struct mca_bus * __devinit mca_attach_bu return NULL; } - mca_bus = kmalloc(sizeof(struct mca_bus), GFP_KERNEL); + mca_bus = kzalloc(sizeof(struct mca_bus), GFP_KERNEL); if (!mca_bus) return NULL; - memset(mca_bus, 0, sizeof(struct mca_bus)); + sprintf(mca_bus->dev.bus_id,"mca%d",bus); sprintf(mca_bus->name,"Host %s MCA Bridge", bus ? "Secondary" : "Primary"); - device_register(&mca_bus->dev); + if (device_register(&mca_bus->dev)) { + kfree(mca_bus); + return NULL; + } mca_root_busses[bus] = mca_bus; _ 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 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 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 drivers-ide-fix-error-return-bugs-interface.patch eisa-handle-sysfs-errors.patch firmware-efivars-handle-error.patch isdn-several-minor-fixes.patch git-gccbug.patch drivers-led-handle-sysfs-errors.patch drivers-mca-handle-sysfs-errors.patch video-ov511stv680-handle-sysfs-errors.patch i2o-handle-a-few-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