Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5747226ybp; Tue, 15 Oct 2019 04:32:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5piEZSU5RQludYoNWtMscHoWrI2Sl7BVe9E7j8HrsHO6BLfo+FHtQEuwxc8lWD3LijI9t X-Received: by 2002:a17:906:16d2:: with SMTP id t18mr32880388ejd.28.1571139174298; Tue, 15 Oct 2019 04:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571139174; cv=none; d=google.com; s=arc-20160816; b=GgEJsW1f0T9wYbJPM8YSDfqvSJQ2r0GIv6Em6DlP8VNEib/3q5OB7Vl+c0+avIduP7 eDQi3z1l8zAX3MCewJWLjTXEK/3QY7yvLTRAZdHF2NaY3AOj/lu4ZKKT6PlmtiCuKeAW 1UJLdtqGmAStk4guwu+QaJDZcRYZIo9H/7g8GYigQBE/WFboZep00buInX8I13RIZ7zG t7AY0wvwfDTjERcqVtlAUkSTmVaDoaAldoJIRiKDW6V19MXpcl/tZrqML377VOrdhX/V mleshM0GicDbsdrx6h1gCZPD/v8EQ+TNf8h/QZm5zwAtPEsymqIqnjNmy4Sdrmho+FZv YtnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wd7DtaXgUzNW9LJeL/qTS16EP4Ypl8BDeHFowIvWeME=; b=WFM7ao2/4EEgyl4VSsuOehU3aaIBFZY418nWP9D8F9h/9WgbS3ZTIOVpF7NHUD9BHk GrHik26RdgZfvKPy/ktn3W6BTzqK9CQSRBDUAG1KO2PPsoCtlSB9dJmwn3yZvvbDMK5k vO9+tjCBU+iFrzsejlLxR6COv9UeuL1WQl5hEszFwmvA6dbrGvyr6IEF+Li//lDzKqwk 1+TTfLdTjry96E55b9BnSC7Zx7V70x5yZXNjIwDJYMtR0P9FUzV3GVu2y1XO13irkPuS YcRcsSNFAo9NfkN1wzAzs3NwY6l+KVJS+EfRSrp/XF8iVb30Ygym5bS/AgPf0ix/MrOM ydVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CJiafd99; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33si14478404edf.121.2019.10.15.04.32.31; Tue, 15 Oct 2019 04:32:54 -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=CJiafd99; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730263AbfJOKRj (ORCPT + 99 others); Tue, 15 Oct 2019 06:17:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:39092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729923AbfJOKRj (ORCPT ); Tue, 15 Oct 2019 06:17:39 -0400 Received: from localhost (unknown [171.76.96.211]) (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 1E78F2083B; Tue, 15 Oct 2019 10:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571134658; bh=xfGawPr58UBjheSl/F7JbyPz+DBSYB1h9/sggCT0fko=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CJiafd99ZoMvX4wveVXN0dlVDyg4QpdEORABUlzV9BdrSv7Y1jQ7xtPwDwIG/ICnv FXkqqOrFtwKFlZtvRR3nuQ9hVQAak8PL7xd0SP6Hp4vJvfpLp039XgxVpoETcs9/ak +sjH4xmqa/RYy6lT4FaUYc3ctHmeh36NQRMc/i7U= Date: Tue, 15 Oct 2019 15:47:34 +0530 From: Vinod Koul To: Baolin Wang Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, dan.j.williams@intel.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, eric.long@unisoc.com, zhenfang.wang@unisoc.com Subject: Re: [PATCH] dmaengine: sprd: Fix the possible memory leak issue Message-ID: <20191015101734.GS2654@vkoul-mobl> References: <170dbbc6d5366b6fa974ce2d366652e23a334251.1570609788.git.baolin.wang@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170dbbc6d5366b6fa974ce2d366652e23a334251.1570609788.git.baolin.wang@linaro.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09-10-19, 17:11, Baolin Wang wrote: > If we terminate the channel to free all descriptors associated with this > channel, we will leak the memory of current descriptor if the current > descriptor is not completed, since it had been deteled from the desc_issued > list and have not been added into the desc_completed list. > > Thus we should check if current descriptor is completed or not, when freeing > the descriptors associated with one channel, if not, we should free it to > avoid this issue. Applied, thanks -- ~Vinod