[RFC PATCH 03/57] drivers: coresight: Drop device references found via bus_find_device

From: Suzuki K Poulose
Date: Mon Jun 03 2019 - 11:54:55 EST


We must drop references to the device found via bus_find_device().

Cc: Mathieu Poirier <mathieu.poirier@xxxxxxxxxx>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
---
drivers/hwtracing/coresight/coresight.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
index 4b13028..37ccd67 100644
--- a/drivers/hwtracing/coresight/coresight.c
+++ b/drivers/hwtracing/coresight/coresight.c
@@ -540,7 +540,7 @@ struct coresight_device *coresight_get_enabled_sink(bool deactivate)

dev = bus_find_device(&coresight_bustype, NULL, &deactivate,
coresight_enabled_sink);
-
+ put_device(dev);
return dev ? to_coresight_device(dev) : NULL;
}

@@ -581,7 +581,7 @@ struct coresight_device *coresight_get_sink_by_id(u32 id)

dev = bus_find_device(&coresight_bustype, NULL, &id,
coresight_sink_by_id);
-
+ put_device(dev);
return dev ? to_coresight_device(dev) : NULL;
}

--
2.7.4