lkml.org 
[lkml]   [2019]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scsi: sun_esp: : Fix object reference leaks in esp_sbus_probe
Date
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
\
 
 \ /
  Last update: 2019-03-27 00:56    [W:0.027 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site