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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux