All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheyu Ma <zheyuma97@gmail.com>
To: jinpu.wang@cloud.ionos.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zheyu Ma <zheyuma97@gmail.com>
Subject: [PATCH] scsi: pm8001: Fix the warning when failing at the probe time
Date: Fri, 15 Jul 2022 15:32:21 +0800	[thread overview]
Message-ID: <20220715073221.3364198-1-zheyuma97@gmail.com> (raw)

When the driver fails at chip_init(), we will get the following warning:

[    7.778705] remove_proc_entry: removing non-empty directory 'irq/21', leaking at least 'pm80xx0'
[    7.779414] WARNING: CPU: 0 PID: 290 at fs/proc/generic.c:720 remove_proc_entry+0x389/0x3f0
[    7.782793] RIP: 0010:remove_proc_entry+0x389/0x3f0
[    7.790813] Call Trace:
[    7.791284]  unregister_irq_proc+0x14c/0x170
[    7.793043]  pci_disable_device+0x1ad/0x380
[    7.793396]  pm8001_pci_probe+0x6d9/0xd40 [pm80xx]

Fix this by free the irq before disabling the pci device.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 drivers/scsi/pm8001/pm8001_init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 9b04f1a6a67d..71ade184ee6f 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -1159,6 +1159,7 @@ static int pm8001_pci_probe(struct pci_dev *pdev,
 err_out_shost:
 	scsi_remove_host(pm8001_ha->shost);
 err_out_ha_free:
+	free_irq(pm8001_ha->irq, sha);
 	pm8001_free(pm8001_ha);
 err_out_free:
 	kfree(sha);
-- 
2.25.1


                 reply	other threads:[~2022-07-15  7:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220715073221.3364198-1-zheyuma97@gmail.com \
    --to=zheyuma97@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.