lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hk0bwcbjh.wl-tiwai@suse.de>
Date:   Mon, 11 Apr 2022 09:41:06 +0200
From:   Takashi Iwai <tiwai@...e.de>
To:     Zheyu Ma <zheyuma97@...il.com>
Cc:     perex@...ex.cz, tiwai@...e.com, alsa-devel@...a-project.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [BUG] ALSA: echoaudio: warning when the driver fails to probe

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?


thanks,

Takashi

---
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1906,9 +1906,6 @@ static int snd_echo_create(struct snd_card *card,
 
 	pci_write_config_byte(pci, PCI_LATENCY_TIMER, 0xC0);
 
-	err = pcim_enable_device(pci);
-	if (err < 0)
-		return err;
 	pci_set_master(pci);
 
 	/* Allocate chip if needed */
@@ -1987,6 +1984,10 @@ static int snd_echo_probe(struct pci_dev *pci,
 		return -ENOENT;
 	}
 
+	err = pcim_enable_device(pci);
+	if (err < 0)
+		return err;
+
 	i = 0;
 	err = snd_devm_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
 				sizeof(*chip), &card);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ