diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-08-27 06:03:01 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-08-28 02:22:16 -0400 |
commit | fb615499f0ad28ed74201c1cdfddf9e64e205424 (patch) | |
tree | 496be913d039044c15d683ab28408bb7e1e6ec94 /sound/isa | |
parent | 2ca320e294a738c9134a71b5029de05edbfc7aad (diff) |
ALSA: opti9xx: Fix conflicting driver object name
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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index 103b33373fd4..6effe99bbb9c 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -173,11 +173,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_opti9xx_pnpids); | |||
173 | 173 | ||
174 | #endif /* CONFIG_PNP */ | 174 | #endif /* CONFIG_PNP */ |
175 | 175 | ||
176 | #ifdef OPTi93X | 176 | #define DEV_NAME KBUILD_MODNAME |
177 | #define DEV_NAME "opti93x" | ||
178 | #else | ||
179 | #define DEV_NAME "opti92x" | ||
180 | #endif | ||
181 | 177 | ||
182 | static char * snd_opti9xx_names[] = { | 178 | static char * snd_opti9xx_names[] = { |
183 | "unknown", | 179 | "unknown", |
@@ -1167,7 +1163,7 @@ static int snd_opti9xx_pnp_resume(struct pnp_card_link *pcard) | |||
1167 | 1163 | ||
1168 | static struct pnp_card_driver opti9xx_pnpc_driver = { | 1164 | static struct pnp_card_driver opti9xx_pnpc_driver = { |
1169 | .flags = PNP_DRIVER_RES_DISABLE, | 1165 | .flags = PNP_DRIVER_RES_DISABLE, |
1170 | .name = "opti9xx", | 1166 | .name = DEV_NAME, |
1171 | .id_table = snd_opti9xx_pnpids, | 1167 | .id_table = snd_opti9xx_pnpids, |
1172 | .probe = snd_opti9xx_pnp_probe, | 1168 | .probe = snd_opti9xx_pnp_probe, |
1173 | .remove = snd_opti9xx_pnp_remove, | 1169 | .remove = snd_opti9xx_pnp_remove, |