From: Dan Carpenter <error27@gmail.com>
To: Rahul Ruikar <rahul.ruikar@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>,
Greg Kroah-Hartman <gregkh@suse.de>,
nm127@freemail.hu, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RESEND/PATCH] usb: gadget: goku_udc: Fix error path
Date: Mon, 4 Oct 2010 16:10:17 +0200 [thread overview]
Message-ID: <20101004141017.GD5692@bicker> (raw)
In-Reply-To: <AANLkTi=K25BbWjsnVNny-9YOVEE1xNsDFMoMfc+P8sWQ@mail.gmail.com>
On Mon, Oct 04, 2010 at 06:54:00PM +0530, Rahul Ruikar wrote:
> Dan,
>
> Following things I tried to do with this change.
> there can be 3 cases where one need to handle device_register()
> 1) reaching error path but device_register() is never called..( ie,
> error occurred before calling device_register() function call, in this
> case "dev->reg_status" will have value "0" and in error handler
> device_unregister() or put_device() will not be called.
>
Good point. This is a bug in the original code.
> 2) error occurred at device_register() ( ie. it fails and calls error
> handler, this way "dev->reg_status" will have value "2" and in error
> handler, based on this value "put_device() will be called.
>
Yeah. But device_register() sucks. It shouldn't require such byzantine
error handling. Someone is working on this.
regards,
dan carpenter
> 3) error occured after device_register() success. ( ie, error occured
> due to some other function, ) in this case "dev->reg_status" will have
> value "1" and in error handler, based on this value
> "device_unregister" will be called.
>
> but anyways someone has now proposed to change it to new usb
> interface, so this patch is of no use now.
>
> Thanks
> Rahul Ruikar
>
next prev parent reply other threads:[~2010-10-04 14:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-03 19:59 [RESEND/PATCH] usb: gadget: goku_udc: Fix error path Rahul Ruikar
2010-10-04 12:22 ` Dan Carpenter
2010-10-04 13:24 ` Rahul Ruikar
2010-10-04 14:10 ` Dan Carpenter [this message]
2010-10-05 13:20 ` Greg KH
2010-10-05 16:53 ` Dan Carpenter
2010-10-05 16:55 ` [PATCH] " Dan Carpenter
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=20101004141017.GD5692@bicker \
--to=error27@gmail.com \
--cc=dbrownell@users.sourceforge.net \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nm127@freemail.hu \
--cc=rahul.ruikar@gmail.com \
/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