From: Jiri Slaby <jslaby@suse.cz>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Jiri Kosina <jkosina@suse.cz>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb-hid-core: Set intfdata to NULL if probe fails
Date: Tue, 22 May 2012 09:56:11 +0200 [thread overview]
Message-ID: <4FBB469B.50801@suse.cz> (raw)
In-Reply-To: <1337629176-1624-1-git-send-email-hdegoede@redhat.com>
On 05/21/2012 09:39 PM, Hans de Goede wrote:
> other drivers which rely on frameworks which only call dev_set_drvdata
> on the interface's device if no drvdata has been set
This looks very broken as it relies on an undocumented behavior. If they
want to do that they should:
* set intfdata to NULL
* call some hook that may set intfdata
* set intfdata to whatever they want if it is still NULL
Right?
What are those frameworks?
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/hid/usbhid/hid-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 5bf91db..70d760f 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -1296,6 +1296,7 @@ err_free:
> kfree(usbhid);
> err:
> hid_destroy_device(hid);
> + usb_set_intfdata(intf, NULL);
> return ret;
> }
>
>
--
js
suse labs
next prev parent reply other threads:[~2012-05-22 7:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 19:39 Hans de Goede
2012-05-22 7:56 ` Jiri Slaby [this message]
2012-05-22 8:09 ` Hans de Goede
2012-05-22 8:29 ` Jiri Slaby
2012-05-22 9:33 ` Hans de Goede
2012-05-22 22:00 ` Jiri Kosina
2012-05-22 22:08 ` Hans de Goede
2012-05-22 22:10 ` Greg KH
2012-05-22 22:14 ` Jiri Kosina
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=4FBB469B.50801@suse.cz \
--to=jslaby@suse.cz \
--cc=hdegoede@redhat.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome