Re: [PATCH 41/47] drivers/base: check errors

Dmitry Torokhov
2006-09-26T17:23:37Z

On 9/26/06, Greg KH <greg@kroah.com> wrote:
> From: Andrew Morton <akpm@osdl.org>
>
> 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