mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: iscsi: fix reference count leak in cxgbi_check_route()
@ 2024-08-19  9:24 Ma Ke
  2024-08-20 23:35 ` michael.christie
  0 siblings, 1 reply; 3+ messages in thread
From: Ma Ke @ 2024-08-19  9:24 UTC (permalink / raw)
  To: James.Bottomley, martin.petersen, m.muzzammilashraf, make24,
	James.Bottomley, kxie, michaelc, akpm
  Cc: linux-scsi, linux-kernel, stable

cxgbi_check_route() dont release the reference acquired by ip_dev_find()
which introducing a reference count leak. We could remedy this by
insuring the reference is released.ip_dev_find().

Cc: stable@vger.kernel.org
Fixes: 9ba682f01e2f ("[SCSI] libcxgbi: common library for cxgb3i and cxgb4i")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
 drivers/scsi/cxgbi/libcxgbi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index bf75940f2be1..6b0f1e8dac40 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -670,6 +670,7 @@ cxgbi_check_route(struct sockaddr *dst_addr, int ifindex)
 		"route to %pI4 :%u, ndev p#%d,%s, cdev 0x%p.\n",
 		&daddr->sin_addr.s_addr, ntohs(daddr->sin_port),
 			   port, ndev->name, cdev);
+	dev_put(ndev);
 
 	csk = cxgbi_sock_create(cdev);
 	if (!csk) {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH] scsi: iscsi: fix reference count leak in cxgbi_check_route()
@ 2023-09-19  7:26 Ma Ke
  0 siblings, 0 replies; 3+ messages in thread
From: Ma Ke @ 2023-09-19  7:26 UTC (permalink / raw)
  To: jejb, martin.petersen, kuba, bvanassche, razor, edumazet, make_ruc2021
  Cc: linux-scsi, linux-kernel

cxgbi_check_route() dont release the reference acquired by ip_dev_find()
which introducing a reference count leak. We could remedy this by
insuring the reference is released.ip_dev_find().

Signed-off-by: Ma Ke <make_ruc2021@163.com>
---
 drivers/scsi/cxgbi/libcxgbi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index abde60a50cf7..435056b27cba 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -670,6 +670,7 @@ cxgbi_check_route(struct sockaddr *dst_addr, int ifindex)
 		"route to %pI4 :%u, ndev p#%d,%s, cdev 0x%p.\n",
 		&daddr->sin_addr.s_addr, ntohs(daddr->sin_port),
 			   port, ndev->name, cdev);
+	dev_put(ndev);
 
 	csk = cxgbi_sock_create(cdev);
 	if (!csk) {
-- 
2.37.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-20 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-19  9:24 [PATCH] scsi: iscsi: fix reference count leak in cxgbi_check_route() Ma Ke
2024-08-20 23:35 ` michael.christie
  -- strict thread matches above, loose matches on Subject: below --
2023-09-19  7:26 Ma Ke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®