Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4878929pjb; Mon, 27 Jul 2020 07:26:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxkdaObe9PWD4Akm+MhTRIk/07Ok903upZCp637SlfLHmgm5/8EhOJAMGdI+tDXcV03yqc X-Received: by 2002:a17:906:854d:: with SMTP id h13mr9185123ejy.446.1595860007343; Mon, 27 Jul 2020 07:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860007; cv=none; d=google.com; s=arc-20160816; b=TS2WPyRiYNhzU6QaDQfGBl3G7WYAmajKvgYwKA1+PUYKgxn4uiDCTeVTkxCsV0Zfwz By5camwFNq895UDiAxTLQ1Tsiaig7Iylg9pdC2owL/YJPPLvvea0oqTufgomw9ddVIZy /Ol8QNYVDqhO7lYTWd8sAeMGOhGOY57kWUqn+5rIYNDD+FzpJQI3954MUQroqskzzagu WdNGZldsdoTGaqtsoez9cBjDwU16lZ5J6r6JbNuAueM2DmVj/LQAaN215tio1pGOqP4c esZVGRTQEDfxCTWS+uvKBoeAOloXugUvg3qUWmvKd0YNMZqSAKtNBTOp5PQf6+PE7jve otMQ== 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=97R3eRwJBY3MEjP2DSrIzqkjuXM+3bdgnekjUVxP58k=; b=MGwomyaON7WS9c+GOLf/CZv0EzNP0sOqpOzXzeVOQ4prZVZpu4qy5F1lFy0KbQUNa/ JfIi84/AxQK2PJNZLMTqXXWsjFOq6u6B7jiMCiCTGc6HiWZjwPbRS1UWbqXBStmtaDOC uyGquz6UaxoHupWanm5rFA+aCnRZef8E2d9RNfDXU0rhLkJzGmeblqOZ8kq10/U3rIdc zxgUX20s1490FH3cRU+an0teyZjvFscNDcafyr8XRJa0IUUZny0xqWAUNWbkv1teZofz pD5uyu9mwYj3SHwktdzsYJ+UX3BTBIpbZnEhud/gXPjjrAXKPMw3EmSYmndTXloeLI7r IcTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nUaw1nwY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si5870088edl.506.2020.07.27.07.26.24; Mon, 27 Jul 2020 07:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nUaw1nwY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732022AbgG0OXJ (ORCPT + 99 others); Mon, 27 Jul 2020 10:23:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:52256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732017AbgG0OXI (ORCPT ); Mon, 27 Jul 2020 10:23:08 -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 6C83D2083E; Mon, 27 Jul 2020 14:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859787; bh=aDH47WXYmEoiCKBRtSqqp2kH1h4RsMqOn8BGWaxOkZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nUaw1nwYw3n2a3ulRmqA4OUjo68FhNUbVrc5DKW9czYGySCfpUVnEwma5dLFI1ALL jjj64rDu9D0fk3VdmUkwkYWqo36HWbNtSslX2xt4pF0Xx0tWZPZT+QOQOgGz0GBvcX hrcYBKyTJj4Gyrmr/Bra3tQ+lgybcfkdRyCQKBFM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Vinod Koul , Sasha Levin Subject: [PATCH 5.7 105/179] dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get() Date: Mon, 27 Jul 2020 16:04:40 +0200 Message-Id: <20200727134937.766221623@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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 From: Yu Kuai [ Upstream commit 1438cde8fe9cb709b569f5829c4c892c0f3f15b3 ] if of_find_device_by_node() succeed and platform_get_drvdata() failed, of_xudma_dev_get() will return without put_device(), which will leak the memory. Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20200618130110.582543-1-yukuai3@huawei.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/ti/k3-udma-private.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/ti/k3-udma-private.c b/drivers/dma/ti/k3-udma-private.c index 0b8f3dd6b1463..77e8e67d995b3 100644 --- a/drivers/dma/ti/k3-udma-private.c +++ b/drivers/dma/ti/k3-udma-private.c @@ -42,6 +42,7 @@ struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property) ud = platform_get_drvdata(pdev); if (!ud) { pr_debug("UDMA has not been probed\n"); + put_device(&pdev->dev); return ERR_PTR(-EPROBE_DEFER); } -- 2.25.1