Re: [BUG] ALSA: echoaudio: warning when the driver fails to probe

From: Zheyu Ma
Date: Mon Apr 11 2022 - 04:50:14 EST


On Mon, Apr 11, 2022 at 3:41 PM Takashi Iwai <tiwai@xxxxxxx> wrote:
>
> On Sun, 10 Apr 2022 11:13:55 +0200,
> Zheyu Ma wrote:
> >
> > Hello,
> >
> > I found a bug in echoaudio.c.
> > When the driver fails at the function snd_echo_create(), it should
> > release resources requested before, otherwise we will get the
> > following warning:
> >
> > [ 3.262866] remove_proc_entry: removing non-empty directory
> > 'irq/21', leaking at least 'snd_indigodj'
> > [ 3.263577] WARNING: CPU: 3 PID: 261 at fs/proc/generic.c:717
> > remove_proc_entry+0x389/0x3f0
> > [ 3.267098] RIP: 0010:remove_proc_entry+0x389/0x3f0
> > [ 3.269976] Call Trace:
> > [ 3.269979] <TASK>
> > [ 3.269988] unregister_irq_proc+0x14c/0x170
> > [ 3.269997] irq_free_descs+0x94/0xe0
> > [ 3.270004] mp_unmap_irq+0xb6/0x100
> > [ 3.270011] acpi_unregister_gsi_ioapic+0x27/0x40
> > [ 3.270017] acpi_pci_irq_disable+0x1d3/0x320
> > [ 3.270025] pci_disable_device+0x1ad/0x380
> > [ 3.270034] pcim_release+0x566/0x6d0
> > [ 3.270046] devres_release_all+0x1f1/0x2c0
> > [ 3.270057] really_probe+0xe0/0x920
>
> Could you try the patch below?

The following patch works for me, the previous warning disappears, thank you.
But I got another error, I have no idea about it.

[ 3.326686] snd_indigodj 0000:00:05.0: Direct firmware load for
ea/indigo_dj_dsp.fw failed with error -2
[ 3.327474] snd_indigodj 0000:00:05.0: get_firmware(): Firmware not
available (-2)
[ 3.328077] snd_indigodj 0000:00:05.0: init_hw err=-2
[ 3.328496] snd_indigodj: probe of 0000:00:05.0 failed with error -2
[ 3.329965] ==================================================================
[ 3.330525] BUG: KASAN: use-after-free in stop_transport+0xa5/0x4c0
[snd_indigodj]
[ 3.331122] Read of size 4 at addr ffff88800943f010 by task systemd-udevd/255
[ 3.333226] Call Trace:
[ 3.333426] <TASK>
[ 3.333595] dump_stack_lvl+0x5a/0x74
[ 3.333888] print_address_description+0x7b/0x440
[ 3.334264] print_report+0x101/0x200
[ 3.334558] ? _printk+0x54/0x6e
[ 3.334818] ? stop_transport+0xa5/0x4c0 [snd_indigodj]
[ 3.335231] kasan_report+0xc1/0xf0
[ 3.335513] ? stop_transport+0xa5/0x4c0 [snd_indigodj]
[ 3.335938] stop_transport+0xa5/0x4c0 [snd_indigodj]
[ 3.336346] snd_echo_free+0x8c/0x410 [snd_indigodj]
[ 3.336741] ? snd_echo_interrupt+0x4b0/0x4b0 [snd_indigodj]
[ 3.337183] release_card_device+0x7d/0x190
[ 3.337519] ? snd_power_wait+0x80/0x80
[ 3.337829] device_release+0x97/0x1c0
[ 3.338127] kobject_put+0x144/0x1c0
[ 3.338417] __snd_card_release+0xe4/0x140
[ 3.338744] devres_release_all+0x1f1/0x2c0
[ 3.339079] really_probe+0xe0/0x920

Regards,
Zheyu Ma