mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: sun_esp: : Fix object reference leaks in esp_sbus_probe
@ 2019-03-26 23:55 Huang Zijiang
  2019-03-27 12:47 ` Mukesh Ojha
  0 siblings, 1 reply; 2+ messages in thread
From: Huang Zijiang @ 2019-03-26 23:55 UTC (permalink / raw)
  To: jejb; +Cc: martin.petersen, linux-scsi, linux-kernel, wang.yi59, Huang Zijiang

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@zte.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


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

end of thread, other threads:[~2019-03-27 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 23:55 [PATCH] scsi: sun_esp: : Fix object reference leaks in esp_sbus_probe Huang Zijiang
2019-03-27 12:47 ` Mukesh Ojha

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®