All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeny Novikov <novikov@ispras.ru>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Evgeny Novikov <novikov@ispras.ru>,
	"Frank A. Cancio Bello" <frank@generalsoftwareinc.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Chuhong Yuan <hslester96@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	ldv-project@linuxtesting.org
Subject: [PATCH] staging: rts5208: fix memleaks on error handling paths in probe
Date: Tue, 23 Jun 2020 17:12:30 +0300	[thread overview]
Message-ID: <20200623141230.7258-1-novikov@ispras.ru> (raw)

rtsx_probe() allocates host, but does not free it on error handling
paths. The patch adds missed scsi_host_put().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
---
 drivers/staging/rts5208/rtsx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index be0053c795b7..937f4e732a75 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -972,6 +972,7 @@ static int rtsx_probe(struct pci_dev *pci,
 	kfree(dev->chip);
 chip_alloc_fail:
 	dev_err(&pci->dev, "%s failed\n", __func__);
+	scsi_host_put(host);
 scsi_host_alloc_fail:
 	pci_release_regions(pci);
 	return err;
-- 
2.16.4


WARNING: multiple messages have this Message-ID (diff)
From: Evgeny Novikov <novikov@ispras.ru>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, ldv-project@linuxtesting.org,
	Arnd Bergmann <arnd@arndb.de>, Evgeny Novikov <novikov@ispras.ru>,
	Chuhong Yuan <hslester96@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Frank A. Cancio Bello" <frank@generalsoftwareinc.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH] staging: rts5208: fix memleaks on error handling paths in probe
Date: Tue, 23 Jun 2020 17:12:30 +0300	[thread overview]
Message-ID: <20200623141230.7258-1-novikov@ispras.ru> (raw)

rtsx_probe() allocates host, but does not free it on error handling
paths. The patch adds missed scsi_host_put().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
---
 drivers/staging/rts5208/rtsx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index be0053c795b7..937f4e732a75 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -972,6 +972,7 @@ static int rtsx_probe(struct pci_dev *pci,
 	kfree(dev->chip);
 chip_alloc_fail:
 	dev_err(&pci->dev, "%s failed\n", __func__);
+	scsi_host_put(host);
 scsi_host_alloc_fail:
 	pci_release_regions(pci);
 	return err;
-- 
2.16.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

             reply	other threads:[~2020-06-23 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 14:12 Evgeny Novikov [this message]
2020-06-23 14:12 ` [PATCH] staging: rts5208: fix memleaks on error handling paths in probe Evgeny Novikov

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=20200623141230.7258-1-novikov@ispras.ru \
    --to=novikov@ispras.ru \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=frank@generalsoftwareinc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hslester96@gmail.com \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.