mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Chris Wright <chrisw@sous-sol.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: check device_create_file() return code in usb_create_sysfs_intf_files()
Date: Thu, 24 Mar 2011 17:05:29 +0200	[thread overview]
Message-ID: <20110324150529.GC8200@swordfish.minsk.epam.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1103241050520.2006-100000@iolanthe.rowland.org>

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 316 bytes --]

      reply	other threads:[~2011-03-24 15:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 14:31 Sergey Senozhatsky
2011-03-24 14:42 ` Michal Nazarewicz
2011-03-24 14:56   ` Sergey Senozhatsky
2011-03-24 14:58     ` Michal Nazarewicz
2011-03-24 14:55 ` Alan Stern
2011-03-24 15:05   ` Sergey Senozhatsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110324150529.GC8200@swordfish.minsk.epam.com \
    --to=sergey.senozhatsky@gmail.com \
    --cc=chrisw@sous-sol.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®