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: 8035041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B765F9F744 for ; Thu, 14 Jan 2016 19:01:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9701203C1 for ; Thu, 14 Jan 2016 19:01:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E363F203E5 for ; Thu, 14 Jan 2016 19:01:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aJn7m-0003Or-FV; Thu, 14 Jan 2016 18:59:58 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aJn6c-0002ae-Mo for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2016 18:58:49 +0000 Received: by mail-pa0-x22b.google.com with SMTP id uo6so365694996pac.1 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=fDwfP6Wm1qor5RnpYkvyDZXOIjDePL5Y54K1r0opJqOSnI6W6wITo/Q4p8o8bmO5C5 9Cy6Pn6Id7t/dVgUhDCfpVQB/27//N3Gp7uOTIEVxc1iCSmjdXsv4ruhKA1ElQK1AIVI 656Fvo1D6QlZ07gTJ0o44wQra12mcWpttJV9/epB7seM355UCj3X7xnuOg/8Ri8NrQkO 3XlE+SYXATJcv8b2ZCRHq5nRf8i7NuxUxjr3jvADCuEaRAdVd44vozakmYznBTjAegdC dXakL2W46kKAopx4Riynu878gXY75Oql02dnrw7d5JuvOmRNYFRITMmTZtwoHhYejPRF zymA== X-Gm-Message-State: ALoCoQm6Rmd99cwnbzPdP+UR2izGMLbiXudANr2Yg5OR4cRsHg3chjjTj3AUQQBo0Jll039RRNOWDmJYH8zafes3X3eX8K5RWQ== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160114_105847_056991_B2C3C8FE X-CRM114-Status: GOOD ( 10.33 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Poirier MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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;