lkml.org 
[lkml]   [2006]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 41/47] drivers/base: check errors
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-26 19:27    [W:0.238 / U:2.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site