提交 0c264af7 编写于 作者: T Takashi Sakamoto 提交者: Takashi Iwai

ALSA: firewire: fix NULL pointer dereference when releasing uninitialized data of iso-resource

When calling 'iso_resource_free()' for uninitialized data, this function
causes NULL pointer dereference due to its 'unit' member. This occurs when
unplugging audio and music units on IEEE 1394 bus at failure of card
registration.

This commit fixes the bug. The bug exists since kernel v4.5.

Fixes: 324540c4 ('ALSA: fireface: postpone sound card registration') at v4.12
Fixes: 8865a31e ('ALSA: firewire-motu: postpone sound card registration') at v4.12
Fixes: b610386c ('ALSA: firewire-tascam: deleyed registration of sound card') at v4.7
Fixes: 86c8dd7f ('ALSA: firewire-digi00x: delayed registration of sound card') at v4.7
Fixes: 6c29230e ('ALSA: oxfw: delayed registration of sound card') at v4.7
Fixes: 7d3c1d59 ('ALSA: fireworks: delayed registration of sound card') at v4.7
Fixes: 04a2c73c ('ALSA: bebob: delayed registration of sound card') at v4.7
Fixes: b59fb190 ('ALSA: dice: postpone card registration') at v4.5
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 0b36f2bd
...@@ -210,9 +210,14 @@ EXPORT_SYMBOL(fw_iso_resources_update); ...@@ -210,9 +210,14 @@ EXPORT_SYMBOL(fw_iso_resources_update);
*/ */
void fw_iso_resources_free(struct fw_iso_resources *r) void fw_iso_resources_free(struct fw_iso_resources *r)
{ {
struct fw_card *card = fw_parent_device(r->unit)->card; struct fw_card *card;
int bandwidth, channel; int bandwidth, channel;
/* Not initialized. */
if (r->unit == NULL)
return;
card = fw_parent_device(r->unit)->card;
mutex_lock(&r->mutex); mutex_lock(&r->mutex);
if (r->allocated) { if (r->allocated) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册