From: Mathieu Poirier Date: Tue, 2 Feb 2016 21:13:58 +0000 (-0700) Subject: coresight: release reference taken by 'bus_find_device()' X-Git-Tag: firefly_0821_release~176^2~4^2~44^2~79 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f03467661ca82e16b05e786c893bb4cb89951ca3;p=firefly-linux-kernel-4.4.55.git coresight: release reference taken by 'bus_find_device()' The reference count taken by function bus_find_device() needs to be released if a child device is found, something this patch is adding. Reported-by: Rabin Vincent Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman (cherry picked from commit f2dfab3568fc32afeac8b698481e80e7ab2dc658) --- diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 8872db4410eb..a35ca54a76c9 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -570,6 +570,8 @@ static void coresight_fixup_device_conns(struct coresight_device *csdev) if (dev) { conn->child_dev = to_coresight_device(dev); + /* and put reference from 'bus_find_device()' */ + put_device(dev); } else { csdev->orphan = true; conn->child_dev = NULL;