Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2dfab35 authored by Mathieu Poirier's avatar Mathieu Poirier Committed by Greg Kroah-Hartman
Browse files

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: default avatarRabin Vincent <rabin@rab.in>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fae54158
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -570,6 +570,8 @@ static void coresight_fixup_device_conns(struct coresight_device *csdev)


		if (dev) {
		if (dev) {
			conn->child_dev = to_coresight_device(dev);
			conn->child_dev = to_coresight_device(dev);
			/* and put reference from 'bus_find_device()' */
			put_device(dev);
		} else {
		} else {
			csdev->orphan = true;
			csdev->orphan = true;
			conn->child_dev = NULL;
			conn->child_dev = NULL;