Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp693339pxb; Tue, 5 Apr 2022 19:03:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3ivT06hIBPaQSwJfJI2L3Qrb5offEet7ic1ykr2uzTyzatTC3ExhR3veT4w3mqShyD8Mz X-Received: by 2002:a17:902:8ec8:b0:156:847b:a8f8 with SMTP id x8-20020a1709028ec800b00156847ba8f8mr6417366plo.121.1649210591283; Tue, 05 Apr 2022 19:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649210591; cv=none; d=google.com; s=arc-20160816; b=zN2wCLjla/VRRDsQx91WxvKPeh1Z3TNUb5PCnfUQYriBe1QpXUItsmCmPTFKEk5Stu iESgLGD5XKnMGRj30xDRwyJClidNwwn+0eMeabc7eSYbSPGXgrZ8S4+xIUJt2jmv2xoB K3o0PWPUaNWZMkNCaF215FW9uRv+lN9FOzRTCygv7YkIQlT/cTVo+eC7hcivrAixAKQm n6c/3WOIkr06Y82HEQuFtFVi5yy30oyoRylt++HI1AETbA8f0OO8HtiGNnZHtf4x0hQ0 5VU7TXU+MGws96kni7aX1aH4NFWMyeNPHyt/KWutZnAr7ebUA7sAcdC2K9x8IzBvP8X4 HWSw== 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=4OEpdjprGLiySWBi1z6bUTXleOV1lAa3m0QQkAgGTXk=; b=lzEveqNBialVYzfNl+K6j2QQxF7/TVU+HdZMOgsxbzR6cD1L23fxrv1RVCuoWw2D+U +xyGsMIQPIi2uu1J7nn+9Zk5bMq0T8n+fh8+4LKwi/dYh3UWimvLGIJzCuJEBLXk8o/i T045cD94UXPyTk4gxra3ScRb7yJeKwisiTMRZGurEQHzLMWoJTZeFkliBbNQ5ThzhxfI QboCbsXsGmrbucciHQvw9aMCdFLVD7m2niG1YhtbQEhO/7MVk/lg6LD24SB5BOpBaehk grt/PfoFK5mZPPtjXoFbZ0Et/GFjFIJfWBJP/9g1GwUrDkzYb2IlvkJ5M8bvkIirvFsw uh5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JMTjb7EL; 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 oo6-20020a17090b1c8600b001bf756ef81csi4498235pjb.139.2022.04.05.19.02.53; Tue, 05 Apr 2022 19:03:11 -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=JMTjb7EL; 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 S236665AbiDEI2S (ORCPT + 99 others); Tue, 5 Apr 2022 04:28:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235039AbiDEH7U (ORCPT ); Tue, 5 Apr 2022 03:59:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E34034BB9; Tue, 5 Apr 2022 00:53:43 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1FA9761668; Tue, 5 Apr 2022 07:53:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FDD3C340EE; Tue, 5 Apr 2022 07:53:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145222; bh=Yfa6Kmyb+1X+6X/9WKFe5fwbMvb+I65yU3dPuaielFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JMTjb7EL1mncZdyrhbFE0Yf8jEg2BufO8r+mnBNjY1zd8pLNJekgJQ+QUiQbn0VH6 mXOrdVBGASoj5YclC7OEOJxmAczzeB0fi62VAm5cvFr1KJ4GiS6TddgeJ2uK/hC6oF d4L2TszEnvKXBdMdIrwC/eQ8ROrDZ2Nm1PhweAD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.17 0328/1126] soc: qcom: ocmem: Fix missing put_device() call in of_get_ocmem Date: Tue, 5 Apr 2022 09:17:55 +0200 Message-Id: <20220405070417.246268174@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 0ff027027e05a866491bbb53494f0e2a61354c85 ] 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 path. Fixes: 01f937ffc468 ("soc: qcom: ocmem: don't return NULL in of_get_ocmem") Signed-off-by: Miaoqian Lin Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220107073126.2335-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/soc/qcom/ocmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index d2dacbbaafbd..97fd24c178f8 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -206,6 +206,7 @@ struct ocmem *of_get_ocmem(struct device *dev) ocmem = platform_get_drvdata(pdev); if (!ocmem) { dev_err(dev, "Cannot get ocmem\n"); + put_device(&pdev->dev); return ERR_PTR(-ENODEV); } return ocmem; -- 2.34.1