Received: by 10.213.65.68 with SMTP id h4csp261782imn; Tue, 3 Apr 2018 20:23:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+GIiZFsHHnzwyxLc5SidU9M7SpvqK20foIUqavyPnX6xNn940LNNu4pBrcDb1E2bjNhSXH X-Received: by 2002:a17:902:1a4:: with SMTP id b33-v6mr16863437plb.303.1522812218142; Tue, 03 Apr 2018 20:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522812218; cv=none; d=google.com; s=arc-20160816; b=i3U+AD/eibkvjkguG6CeNJK7LRqkDir28Mxk6xLScHJ6cknxsQJWXvmiVjTaavTLvh Fwm7i4ch7Ydv2uMzW0w0VusMQ/WnO93aUtGe/lJYycB5Ihs/j4oBPdlty8CvEKVYop/P ycJ3lLvDlRisT0QA3bzQEAm57P1SBJNKYW382J75E4PTL3KqJdqwaT3Kf/10MJPtZ98L 5GpX2C5uTuWNKAAQGLcfqS4CQYaQjGB+tPOa03CWTuVkxSZbCQGaOHfnmVKSmf8jg6/3 etyr/jtl/mUdJtk+pX3OpzdGDPPm8dwbw2szTe8CrGC/Ri4zfohHC5jXHKeMqbuLTT6d vE/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=WjrgDsaLNDHT+Ex0QqBwb311vHW9X2inCMS57jEm6nQ=; b=BL+RAKrGeDAMp3gz6hy0tVEBAM+EDJXlidFKOgverInY13UtpszoOADJuktIgvrdkw ZlLQtnJ0P1ItMaBIGwSsJowrAFBb+huZK/trKjTc7Nd3RTp4ghwCAaXszp/Ruil/gISf EpPk3kYa/HGwLTCqieaE0lN6FwlJAYG3oK4+SDVy59t76VcIgBbNNZaMB5RnT1pa4kNF LndpKUCiaSxDihyCzpa9pKT0CzlkQdzBLtBABrprWLk7GHDhMIQZFv+oSMtq+nyL6vT5 mmy/zNCDaYbFNbAyWunuXwQh4RMJVNDvFrx/D+swUErQv7FXBK9vaMu//2fgT179LE8K Kz9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=HNRaY8VJ; 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 y92-v6si2111646plb.198.2018.04.03.20.23.23; Tue, 03 Apr 2018 20:23:38 -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=@163.com header.s=s110527 header.b=HNRaY8VJ; 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 S1753261AbeDDDWQ (ORCPT + 99 others); Tue, 3 Apr 2018 23:22:16 -0400 Received: from m12-11.163.com ([220.181.12.11]:43917 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752834AbeDDDWP (ORCPT ); Tue, 3 Apr 2018 23:22:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=WjrgDsaLNDHT+Ex0Qq Bwb311vHW9X2inCMS57jEm6nQ=; b=HNRaY8VJ0GdgbWyc6Ej6GGuDvL9qTPx+bw ov+F6RspYVwtkloV2iHfQ2kh4e+8yHGuvTqA62J/fQ5bi9Ygc+dRSnvpDtJyzvrI KVDXtdiNJFR45YwxDFKk0Jo/uXbnKDZHmD4vMcGaL67vI4Ao/eHKwdL4O0xwSfO6 PJzpDH37s= Received: from localhost.localdomain (unknown [106.120.213.14]) by smtp7 (Coremail) with SMTP id C8CowACXLLzdRMRa_gBeNQ--.8596S3; Wed, 04 Apr 2018 11:22:09 +0800 (CST) From: Xidong Wang To: Vinod Koul , Dan Williams Cc: Xidong Wang , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] dmaengine:jz4740:fix memory leak Date: Wed, 4 Apr 2018 11:21:58 +0800 Message-Id: <1522812118-25763-1-git-send-email-wangxidong_97@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: C8CowACXLLzdRMRa_gBeNQ--.8596S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7XFyDKF13ZryxJw4UKF17Jrb_yoW3Xrc_C3 WUuryrZrsYkFnxKr1jyrnxZryI9FZ29FZxWwsrt34fKrWrJr15W3y2vr1kGw42grW8GFZ8 A3Wjgr4xCF45JjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5c2-UUUUUU== X-Originating-IP: [106.120.213.14] X-CM-SenderInfo: pzdqw5xlgr0wrbzxqiywtou0bp/1tbi8AEe81UMDaLPWwAAs+ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function jz4740_dma_probe(), the memory allocated by clk_get() is not released on the error path that ret, which holds the return value of dma_async_device_register(), is not NULL. This will result in a memory leak bug. Signed-off-by: Xidong Wang --- drivers/dma/dma-jz4740.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c index afd5e10..082c158 100644 --- a/drivers/dma/dma-jz4740.c +++ b/drivers/dma/dma-jz4740.c @@ -570,6 +570,7 @@ static int jz4740_dma_probe(struct platform_device *pdev) dma_async_device_unregister(dd); err_clk: clk_disable_unprepare(dmadev->clk); + clk_put(dmadev->clk); return ret; } -- 2.7.4