From patchwork Thu Jan 14 18:57:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 59767 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp68356lbb; Thu, 14 Jan 2016 10:58:52 -0800 (PST) X-Received: by 10.66.164.196 with SMTP id ys4mr8333355pab.119.1452797932218; Thu, 14 Jan 2016 10:58:52 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hs5si10792693pac.243.2016.01.14.10.58.51; Thu, 14 Jan 2016 10:58:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932236AbcANS6p (ORCPT + 29 others); Thu, 14 Jan 2016 13:58:45 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:36747 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932133AbcANS60 (ORCPT ); Thu, 14 Jan 2016 13:58:26 -0500 Received: by mail-pa0-f48.google.com with SMTP id yy13so288493015pab.3 for ; Thu, 14 Jan 2016 10:58:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DGiO6jbtiE7z3M6U8cPqzVMZsw/1n22tqBlGc89sGRQ=; b=GyRFZtU+Yo2+Ps/oXSXE8/nN3p4SHVHx0iY9w+c5Igb8bb30M6jVw1gzA4VUqJAZcr vQaM9YjovD57EdE4bzL62z/xcyhECu9AIYQ+KfZvly0Hter+WQ1WGjeZ17EDUYu0sK5k AzDAJB9szi3Ivn3sW/1RUbAtAKQRlejP3cfqU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DGiO6jbtiE7z3M6U8cPqzVMZsw/1n22tqBlGc89sGRQ=; b=PIKFqZhe4/Lzy+NXPFGSX7mU9Buh8LG8KzlfmV7zxP7j3jx3RJA7q7vFf3yXFWq0sB oUROSrN+tWRSJvBPBqLZoLclZzVyeSCbmScalWXse6KYQVwmj6IxN1HzShbgDaviE2gV ilN9U1B/g+IOGPGqRCJ3iE/wg86vKdEch2bPbkoZy4fBFX0wjCKwKyeA0wDgs21arCly q8mVqMQraCNJVjaj2fUofObZ+UkDunNIw+4tnz1R0QzYvgPKC9JlAx/0TCKlvX7ahnvN zcMeMO0xlW6dx+vtv5EhEtOdQk3+2CHO+oKE+cstg+JuJEvkmZiL019Uvqp7nxahFo26 dAhw== X-Gm-Message-State: ALoCoQklkD4QVzWNn5vViQQKpqIb8kEPbIbNTPiejmfLTbp2L4tbq/gjwwZLsN+lZykE7Epu0hs6UDmwk4Oyv5PgCP5Pk8xgrg== X-Received: by 10.67.23.226 with SMTP id id2mr8288021pad.149.1452797906085; Thu, 14 Jan 2016 10:58:26 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id p87sm10854256pfi.94.2016.01.14.10.58.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 10:58:25 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mathieu Poirier Subject: [PATCH 4/5] coresight: release reference taken by 'bus_find_device()' Date: Thu, 14 Jan 2016 11:57:59 -0700 Message-Id: <1452797880-4365-5-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452797880-4365-1-git-send-email-mathieu.poirier@linaro.org> References: <1452797880-4365-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/hwtracing/coresight/coresight.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.1.4 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;