Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4424778pxv; Tue, 20 Jul 2021 03:34:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJiCN5HVIBaVboXefABp5F2keIEYR5TfyZqLVCaRzz95H42v+DrZrcISlQmkm1gGCMKRgQ X-Received: by 2002:a92:d44b:: with SMTP id r11mr20844662ilm.217.1626777273566; Tue, 20 Jul 2021 03:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626777273; cv=none; d=google.com; s=arc-20160816; b=tHLG7WjrM25sTdQL25PJYYmYGBuFXfgptJQw3pbF89mqq4ya1O1FQ+TB5bN95mE4JW jmaG4HFUVhwaX9b1xIBSvv7QM4+xZtdlvPs4UtiHBFsVuiLQESaMu4sER51tMUkpGOkm RHVESpXcCL8RT9S740dqzqblsVagKJfleQatCNqUomJauN3rSkLJqzAdRjS4KW5DJ1/r srG59de61gKKyNimExWfSAtlPJROK3h5VWqA+7Ry39HWiUjHNUGqh3XVF32Cq4EhacU2 TTG/sU2KDLjOsA/lregRn/lo3NnJrlUtYYzvuOpzvP1y3N/P6aQ8UJAizuvRLexXhBBX bx7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=f3j2IZWbQ9BuhB8HFfT6eWvOcnhZjbzGtfad31SUHHI=; b=dTOFGL4wo35uLKiJZmE0vp1Ef5FD66iH65OcmcnK/hlcVARHDNL91hodkqRWJYAtsY JwBZux9UOKNkETDyg+jmQlxy96FmaMc70N8tvUnfO3oP6HW38JJXhU2c0YpkQgWucYzj xnUpOELuq+kEERg5WjJexCH117LciSUyg6w0w+dOcwvfJFjROck68aVIdpKZ1oQ6Zrja psVMsOWMDqChhQYYz2IC4BSDSxfYuyQWvAw68xVs9Uo466W0LGS1QgR71ke35fgKuOAe uIcnLJWNgRUNLjUmADwwNdlexCstTDWp8mqkBeb7am62uoz9lF4GfEikFDn5qI9lZ0pm C8hg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si9247545jav.118.2021.07.20.03.34.22; Tue, 20 Jul 2021 03:34:33 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237485AbhGTJwy (ORCPT + 99 others); Tue, 20 Jul 2021 05:52:54 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:39334 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S237496AbhGTJvm (ORCPT ); Tue, 20 Jul 2021 05:51:42 -0400 X-UUID: 5c065068862d4c1aad0d01e95df3bc07-20210720 X-UUID: 5c065068862d4c1aad0d01e95df3bc07-20210720 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 468062627; Tue, 20 Jul 2021 18:32:15 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 20 Jul 2021 18:32:08 +0800 Received: from mszswglt01.gcn.mediatek.inc (10.16.20.20) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 20 Jul 2021 18:32:01 +0800 From: To: CC: , , , , , , , , , , Guangming Cao Subject: [PATCH v2] dma_buf: remove dmabuf sysfs teardown before release Date: Tue, 20 Jul 2021 18:31:58 +0800 Message-ID: <20210720103158.83439-1-guangming.cao@mediatek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <8d7dfc78-aa85-48b5-2828-21ec6b463ac3@amd.com> References: <8d7dfc78-aa85-48b5-2828-21ec6b463ac3@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guangming Cao Dmabuf sysfs stat is used for dmabuf info track. But these file maybe still in use after buffer released, should clear it before buffer release. Signed-off-by: Guangming Cao --- drivers/dma-buf/dma-buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index b1a6db71c656..63d32261b63f 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -76,12 +76,12 @@ static void dma_buf_release(struct dentry *dentry) */ BUG_ON(dmabuf->cb_shared.active || dmabuf->cb_excl.active); + dma_buf_stats_teardown(dmabuf); dmabuf->ops->release(dmabuf); if (dmabuf->resv == (struct dma_resv *)&dmabuf[1]) dma_resv_fini(dmabuf->resv); - dma_buf_stats_teardown(dmabuf); module_put(dmabuf->owner); kfree(dmabuf->name); kfree(dmabuf); -- 2.17.1