Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp892779yba; Thu, 18 Apr 2019 11:19:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqywn8XCldWrwtrVPK7fpI58Ky1AE9fOeUAbbZdDqWS0cjHdVE/VULkaTpW+gLU+rU8RcJ5L X-Received: by 2002:aa7:8458:: with SMTP id r24mr96349359pfn.231.1555611556452; Thu, 18 Apr 2019 11:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611556; cv=none; d=google.com; s=arc-20160816; b=PNyXw5hEYh3vnEY7i1msEjKsXxGb1P3T6cOTtuaQI1Y7P40iDpTgXzI/5gPd8k6cBl s9OXR6Vm3vGwdzL8xHCW0bsIWc/hc9bUB1XDB6rpic4U8AgV6D4KHJQvSos8s+9zIDYK EPaLAE8zLEza6jB+Pp9Y8/6ydo3KnHbGGHHfPcXAwGne6icFeog+FyHySJJ6zg7U7xpy b3CtHlvHILN1fChFIpcJ8D1zsrlpaMYpTDO9BGYSHew0j1qLBcWyTiT3kDix2WGo/b/U NcbRuvo7xt1yPUMGi+f10QozW7AgOlhoo7mMdHNsO8kwAnJUZStIwbiLUjr5a7nPIRN/ trag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NFO1oWiTTmBkcQZ60lWxKDFaPftF3JP/c5s49yaqp7A=; b=NUA1zzTAipmOfhFIl7apGLCeDO/gNrxVesJBNCXJbC9CBJLTz/0LPeYfkCCUkBQ6+g g5iFxJUtizQCRtHzb4ar33/EpsokGObjb7Zf0958xKykpEc4phPL4zq5Yzq5ZXehxlK2 Muw+RH+bgm+sa5hW2JB56FLZ7+R9K3lEDjSMwfo4xyMblD1QWo2U0VvnbmvsiQfrKjdS DiAn+wcFyRmDa62HxlQCpVEpIpSJ9q/zGjJS9MfXyMvaD1zPXxJttpZqDSiS2FT+Vqog 4MU7yGHmvtcnp/e21unwTpsmSz1qIa11n2O8fIv3HqFk8waATz/+6KktnOxd3FQTRS4u W0Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yCylNhTe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si2371703pgs.33.2019.04.18.11.19.01; Thu, 18 Apr 2019 11:19:16 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=yCylNhTe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391910AbfDRSLS (ORCPT + 99 others); Thu, 18 Apr 2019 14:11:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:43404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391339AbfDRSLO (ORCPT ); Thu, 18 Apr 2019 14:11:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 501FC20652; Thu, 18 Apr 2019 18:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611073; bh=AcHtwJZLIP5ZxBGvwr0IP7u79ECIX+JnBeYDJZZPisI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yCylNhTecXgQc+or1Neh+fFYEJ8WjaD/WW3T7K0YvZCsJb1qUt1Sj9jzZa/B7wPNl u5ds+5WASzM9x4xShDrNl2wsyHYtGd6Q1Tgd5/BgPgmV9bLhcdzAdqSwF0QafE5rxK R257eQLy1DaZLAIP9I9EwwCAzpC00QnH9M+ByCgk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Hans de Goede , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.0 49/93] ACPI / utils: Drop reference in test for device presence Date: Thu, 18 Apr 2019 19:57:27 +0200 Message-Id: <20190418160442.669081906@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 54e3aca84e571559915998aa6cc05e5ac37c043b ] When commit 8661423eea1a ("ACPI / utils: Add new acpi_dev_present helper") introduced acpi_dev_present(), it missed the fact that bus_find_device() took a reference on the device found by it and the callers of acpi_dev_present() don't drop that reference. Drop the reference on the device in acpi_dev_present(). Fixes: 8661423eea1a ("ACPI / utils: Add new acpi_dev_present helper") Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 78db97687f26..c4b06cc075f9 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -800,6 +800,7 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) match.hrv = hrv; dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); + put_device(dev); return !!dev; } EXPORT_SYMBOL(acpi_dev_present); -- 2.19.1