[RFC 0/2] kobject_set_name - error handling

Maneesh Soni
2004-04-30T10:10:52Z

IMO error handling/propogation is incorrect or not there in most of the places
in the users of kobject_set_name. sysfs_rename_dir is one of them.

1) sysfs_rename_dir ignores return code from kobject_set_name,
and returns void
2) kobject_rename returns void
3) dev_change_name ignore return code from class_device_rename.

This can lead to mismatch in kobject name and the directory name. Now
correcting this will involve changing the APIs at this point of time.
Luckily we have just one user of sysfs_rename_dir as of now.

Like this there are 14 other users of kobject_set_name and only one checks
the return code. Out of them atleast following are problematic IMO.

bus_add_driver()
bus_register()
sys_dev_register()
sysfs_rename_dir()

Others are not because we have name length less than KOBJ_NAME_LEN and there
will be no allocation. I have corrected the above problems in the following
two patches.

Please comment.

Thanks,
Maneesh

--
Maneesh Soni
Linux Technology Center,
IBM Software Lab, Bangalore, India
email: maneesh@in.ibm.com
Phone: 91-80-25044999 Fax: 91-80-25268553
T/L : 9243696