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-next>] [day] [month] [year] [list]
Message-Id: <1553644557-35817-1-git-send-email-huang.zijiang@zte.com.cn>
Date:   Wed, 27 Mar 2019 07:55:57 +0800
From:   Huang Zijiang <huang.zijiang@....com.cn>
To:     jejb@...ux.ibm.com
Cc:     martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org, wang.yi59@....com.cn,
        Huang Zijiang <huang.zijiang@....com.cn>
Subject: [PATCH] scsi: sun_esp: : Fix object reference leaks in esp_sbus_probe

The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference whatever of_find_device_by_node
reutrns.

Signed-off-by: Huang Zijiang <huang.zijiang@....com.cn>
---
 drivers/scsi/sun_esp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index a11efbc..a74605a 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -543,9 +543,8 @@ static int esp_sbus_probe(struct platform_device *op)
 		return -ENODEV;
 
 	ret = esp_sbus_probe_one(op, dma_of, hme);
-	if (ret)
-		put_device(&dma_of->dev);
 
+	put_device(&dma_of->dev);
 	return ret;
 }
 
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ