On 9/26/06, Greg KH <[email protected]> wrote:
From: Andrew Morton <[email protected]> Add lots of return-value checking. + if (error) + goto out; + error = sysfs_create_link(&bus->devices.kobj, + &dev->kobj, dev->bus_id); + if (error) + goto out; + error = sysfs_create_link(&dev->kobj, + &dev->bus->subsys.kset.kobj, "subsystem"); + if (error) + goto out; + error = sysfs_create_link(&dev->kobj, + &dev->bus->subsys.kset.kobj, "bus"); } +out: return error;
What about removing the links that were created if one of these calls fails? -- Dmitry - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH 41/47] drivers/base: check errors
- From: Greg KH <[email protected]>
- Re: [PATCH 41/47] drivers/base: check errors
- References:
- [GIT PATCH] Driver Core patches for 2.6.18
- From: Greg KH <[email protected]>
- [PATCH 33/47] kobject: must_check fixes
- From: Greg KH <[email protected]>
- [PATCH 34/47] sysfs_remove_bin_file: no return value, dump_stack on error
- From: Greg KH <[email protected]>
- [PATCH 35/47] Driver core: fix comments in drivers/base/power/resume.c
- From: Greg KH <[email protected]>
- [PATCH 36/47] Driver core: fixed add_bind_files() definition
- From: Greg KH <[email protected]>
- [PATCH 37/47] add __must_check to device management code
- From: Greg KH <[email protected]>
- [PATCH 38/47] add CONFIG_ENABLE_MUST_CHECK
- From: Greg KH <[email protected]>
- [PATCH 39/47] v4l-dev2: handle __must_check
- From: Greg KH <[email protected]>
- [PATCH 40/47] drivers/base: Platform notify needs to occur before drivers attach to the device
- From: Greg KH <[email protected]>
- [PATCH 41/47] drivers/base: check errors
- From: Greg KH <[email protected]>
- [GIT PATCH] Driver Core patches for 2.6.18
- Prev by Date: Re: When will the lunacy end? (Was Re: [PATCH] uswsusp: add pmops->{prepare,enter,finish} support (aka "platform mode"))
- Next by Date: Re: [PATCH] restore libata build on frv
- Previous by thread: Re: [PATCH 44/47] PCI: enable driver multi-threaded probe
- Next by thread: Re: [PATCH 41/47] drivers/base: check errors
- Index(es):