lkml.org 
[lkml]   [2011]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: check device_create_file() return code in usb_create_sysfs_intf_files()
On (03/24/11 10:55), Alan Stern wrote:
> > I just noticed that usb_create_sysfs_intf_files() ignores device_create_file()
> > return code and sets intf->sysfs_files_created to 1, even if sysfs_add_file_mode()
> > returned -ENOMEM (or later sysfs_add_one() returned -EEXIST).
> >
> > Shouldn't we check retval for 0 before setting intf->sysfs_files_created?
>
> No. We want this routine to succeed even if the sysfs files can't be
> created. The interface string attribute is more or less optional.
>
> It would be okay to add a comment explaining this, so that other people
> don't make the same mistake (which has already happened -- you're not
> the first).
>

Thanks. Sorry for the noise then.
Well, in that case, I guess, `int retval;' can be removed, since it's
unused.


Best,
Sergey
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2011-03-24 16:03    [from the cache]
©2003-2011 Jasper Spaans