ALSA: opti9xx: Fix conflicting driver object name
authorTakashi Iwai <tiwai@suse.de>
Tue, 27 Aug 2013 10:03:01 +0000 (12:03 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 10 Sep 2013 00:57:40 +0000 (01:57 +0100)
commit9f9c4293221704c89b838e446ac846050d79804f
tree16cec5b2a0630df8cc32655598601fc463c64170
parent0a3a0aeeab072803685c1cb45e1780f2ab6a5b9c
ALSA: opti9xx: Fix conflicting driver object name

commit fb615499f0ad28ed74201c1cdfddf9e64e205424 upstream.

The recent commit to delay the release of kobject triggered NULL
dereferences of opti9xx drivers.  The cause is that all
snd-opti92x-ad1848, snd-opti92x-cs4231 and snd-opti93x drivers
register the PnP card driver with the very same name, and also
snd-opti92x-ad1848 and -cs4231 drivers register the ISA driver with
the same name, too.  When these drivers are built in, quick
"register-release-and-re-register" actions occur, and this results in
Oops because of the same name is assigned to the kobject.

The fix is simply to assign individual names.  As a bonus, by using
KBUILD_MODNAME, the patch reduces more lines than it adds.

The fix is based on the suggestion by Russell King.

Reported-and-tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/isa/opti9xx/opti92x-ad1848.c