Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp663695pxb; Tue, 5 Apr 2022 17:51:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2BlwDX1bHDNj5nBKDBcOnfi15LIjqKBeFB5O7FnDUvlWD3wqohSvDuK5hQ5S/PVVrXTsR X-Received: by 2002:a65:4b85:0:b0:399:8cd:5270 with SMTP id t5-20020a654b85000000b0039908cd5270mr4922835pgq.418.1649206290030; Tue, 05 Apr 2022 17:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206290; cv=none; d=google.com; s=arc-20160816; b=f5+OB424Nh1H2avynlZ0OjcveMqljNFehd0wzkLx4VbTHOyPPyLlvJJZi7Ox1dikAB m3NcDXhyiv1hHPMETaPhQaiSQWFrjOZVNvQGFioZBWeWbc7t01i1DkwzkBNNpE1lpPZd +4N61WstzNC8rcmWC3m0QzUcKOlOSSMjMqPxCSQABcwLBF7T+/vcZZ1TN0wotxcEzGIy HIVQfPC3e22gDheh9eXoEalS+qT1TxzQLTkhPu9vnUw3UE30/MBdISk/JSviOA3S1qxz NYBuiqtCK/n8p1+F4v0ROkkeprSUAq4009BseutfD5srbOKiGkmsXNthubMSa6dPUvbT y50A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r+81xgWkahYKXPRhrCMMNX0PMq3PNFmlRVbSDM5MSbY=; b=ArMQS8Y/UyzjBIhR918CyIfGwrvrEJt5dUVJT22TZVOmTnNwHsaBvegVxggtG5dVkd nA+aE+/Eh8gwkolNwaZ/zEMn1poRKjBi4DnkHX8aOjLDB/7LiSIQUOGZtHRfEUuWWJ0F C7++qZbSt67GrljZC5VdsW0sCwNHVdP0/8w9IujwQyxLvdb+VuN/5C4Vz/S2pdKNPs5C jxDDFEZt1gd+wy+0JUAjYPQbUV37RnyrqR8tX6NAIq4/ZQkry0XCMEMfZHFpuZGIqIu5 H2pZvVYdqTcIBOeMbGPkQ6SADMSLwVbnXFyDSvPUbRdlaGnM8vElPvsrklGnlqcVP429 IRnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dJaHsze0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t9-20020a656089000000b003816043ef72si14400142pgu.359.2022.04.05.17.51.15; Tue, 05 Apr 2022 17:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dJaHsze0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234931AbiDEIOc (ORCPT + 99 others); Tue, 5 Apr 2022 04:14:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235110AbiDEH7Y (ORCPT ); Tue, 5 Apr 2022 03:59:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AF115675D; Tue, 5 Apr 2022 00:53:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6E212B81B9C; Tue, 5 Apr 2022 07:53:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBF35C340EE; Tue, 5 Apr 2022 07:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145225; bh=phuxJo7oRmldSO2cwujmdOqMdhQCoMAdhkZWFNfJytE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dJaHsze0YeKMAuHOjWBrvKUlHWs6b1pkDthI8+hLwEHlILC3/iGubhPE1uNLQTKAb RdD4ZwEBRp4GOyRYd3L8YW8Z9JcGK11K95UHzo8DwHhWli0Z/0ZPVVHGM4TjkV4OrV wxGi6PbtUWQjqxtAX7S9cqYPyO3KElglVHwhwxPc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Stephen Boyd , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.17 0329/1126] soc: qcom: aoss: Fix missing put_device call in qmp_get Date: Tue, 5 Apr 2022 09:17:56 +0200 Message-Id: <20220405070417.275513555@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit 4b41a9d0fe3db5f91078a380f62f0572c3ecf2dd ] The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling paths. Fixes: 8c75d585b931 ("soc: qcom: aoss: Expose send for generic usecase") Signed-off-by: Miaoqian Lin Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220108095931.21527-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/soc/qcom/qcom_aoss.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c index cbe5e39fdaeb..563ae0a501dc 100644 --- a/drivers/soc/qcom/qcom_aoss.c +++ b/drivers/soc/qcom/qcom_aoss.c @@ -451,7 +451,11 @@ struct qmp *qmp_get(struct device *dev) qmp = platform_get_drvdata(pdev); - return qmp ? qmp : ERR_PTR(-EPROBE_DEFER); + if (!qmp) { + put_device(&pdev->dev); + return ERR_PTR(-EPROBE_DEFER); + } + return qmp; } EXPORT_SYMBOL(qmp_get); -- 2.34.1