From: Johannes Berg <johannes@sipsolutions.net>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
linville@tuxdriver.com, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, Stable <stable@vger.kernel.org>
Subject: Re: [PATCH] rtlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id
Date: Wed, 06 Feb 2013 10:01:17 +0100 [thread overview]
Message-ID: <1360141277.7910.9.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1360113382.2857.48.camel@bwh-desktop.uk.solarflarecom.com> (sfid-20130206_021632_180510_96D16282)
On Wed, 2013-02-06 at 01:16 +0000, Ben Hutchings wrote:
> > I don't know why USB differs from PCI, but we do need the dynamic ID here as
> > there are always new IDs being issued. One of the criteria for adding the ID to
> > the table is that it works OK with dynamic addition. These devices are
> > frequently reported by users that do not have the skills to build their own kernel.
>
> But since there is no way to set the driver_info for a new USB ID
> (again, unlike PCI), your change will reject all dynamic IDs. (And in
> any case, if the USB core were changed to allow setting driver_info,
> userland would have difficulty providing a valid pointer!)
>
> It looks like the driver_info is really driver-specific data used to
> share a probe function between multiple drivers. But you could add
> per-driver probe functions that pass the correct rtl_hal_cfg as an extra
> argument to rtl_usb_probe(), and then dynamic IDs should work.
Some (PCI?) drivers had/have numbers instead of pointers, so userland
can provide a number and it then looks up the pointer in an array.
That's only slightly indirected but makes new_id more useful in that
case.
johannes
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
To: Ben Hutchings <bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
Cc: Larry Finger
<Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>,
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stable <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] rtlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id
Date: Wed, 06 Feb 2013 10:01:17 +0100 [thread overview]
Message-ID: <1360141277.7910.9.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1360113382.2857.48.camel-/LGg1Z1CJKReKY3V0RtoKmatzQS1i7+A3tAM5lWOD0I@public.gmane.org> (sfid-20130206_021632_180510_96D16282)
On Wed, 2013-02-06 at 01:16 +0000, Ben Hutchings wrote:
> > I don't know why USB differs from PCI, but we do need the dynamic ID here as
> > there are always new IDs being issued. One of the criteria for adding the ID to
> > the table is that it works OK with dynamic addition. These devices are
> > frequently reported by users that do not have the skills to build their own kernel.
>
> But since there is no way to set the driver_info for a new USB ID
> (again, unlike PCI), your change will reject all dynamic IDs. (And in
> any case, if the USB core were changed to allow setting driver_info,
> userland would have difficulty providing a valid pointer!)
>
> It looks like the driver_info is really driver-specific data used to
> share a probe function between multiple drivers. But you could add
> per-driver probe functions that pass the correct rtl_hal_cfg as an extra
> argument to rtl_usb_probe(), and then dynamic IDs should work.
Some (PCI?) drivers had/have numbers instead of pointers, so userland
can provide a number and it then looks up the pointer in an array.
That's only slightly indirected but makes new_id more useful in that
case.
johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-02-06 9:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 0:00 [PATCH] rtlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id Larry Finger
2013-02-06 0:18 ` Ben Hutchings
2013-02-06 0:44 ` Larry Finger
2013-02-06 1:16 ` Ben Hutchings
2013-02-06 9:01 ` Johannes Berg [this message]
2013-02-06 9:01 ` Johannes Berg
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=1360141277.7910.9.camel@jlt4.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=Larry.Finger@lwfinger.net \
--cc=bhutchings@solarflare.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.