Kernel-Janitors Archive on
 help / color / Atom feed
From: Christophe JAILLET <>
	Christophe JAILLET <>
Subject: [PATCH] tty: nozomi: Fix a resource leak in an error handling function
Date: Sun,  9 May 2021 19:22:33 +0200
Message-ID: <> (raw)

A 'request_irq()' call is not balanced by a corresponding 'free_irq()' in
the error handling path, as already done in the remove function.

Add it.

Fixes: 9842c38e9176 ("kfifo: fix warn_unused_result")
Signed-off-by: Christophe JAILLET <>
I also wonder if the loop above is correct. The 'i < MAX_PORT' looks really
spurious to me.
'tty_port_destroy' can be called twice for the same entry (once before
branching in the error handling path, and once in here) and
'tty_unregister_device'/'tty_port_destroy' will be called on entries
that have not been 'tty_port_init'ed or 'tty_port_register_device'd.
I don't know if it may be an issue.
 drivers/tty/nozomi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c
index 9a2d78ace49b..b270e137ef9b 100644
--- a/drivers/tty/nozomi.c
+++ b/drivers/tty/nozomi.c
@@ -1420,6 +1420,7 @@ static int nozomi_card_init(struct pci_dev *pdev,
 		tty_unregister_device(ntty_driver, dc->index_start + i);
+	free_irq(pdev->irq, dc);
 	for (i = 0; i < MAX_PORT; i++)

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-09 17:22 Christophe JAILLET [this message]
2021-05-10  6:35 ` Dan Carpenter
2021-05-10  9:51 ` Jiri Slaby

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:

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

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel-Janitors Archive on

Archives are clonable:
	git clone --mirror kernel-janitors/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernel-janitors kernel-janitors/ \
	public-inbox-index kernel-janitors

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone