lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251114084246.2064845-1-buaajxlj@163.com>
Date: Fri, 14 Nov 2025 16:42:44 +0800
From: Liang Jie <buaajxlj@....com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Christian Brauner <brauner@...nel.org>,
	Jan Kara <jack@...e.cz>,
	Chen Ni <nichen@...as.ac.cn>,
	Mateusz Guzik <mjguzik@...il.com>,
	Akash M <akash.m5@...sung.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Owen Gu <guhuinan@...omi.com>,
	Ingo Rohloff <ingo.rohloff@...terbach.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	linux-usb@...r.kernel.org (open list:USB SUBSYSTEM),
	linux-kernel@...r.kernel.org (open list)
Cc: liangjie@...iang.com,
	fanggeng@...iang.com,
	yangchen11@...iang.com
Subject: [PATCH] usb: gadget: functionfs: use dma_buf_unmap_attachment_unlocked() helper

From: Liang Jie <liangjie@...iang.com>

Replace the open-coded dma_resv_lock()/dma_resv_unlock() around
dma_buf_unmap_attachment() in ffs_dmabuf_release() with the
dma_buf_unmap_attachment_unlocked() helper.

This aligns FunctionFS DMABUF unmap handling with the standard
DMA-BUF API, avoids duplicating locking logic and eases future
maintenance. No functional change.

Reviewed-by: fanggeng <fanggeng@...iang.com>
Signed-off-by: Liang Jie <liangjie@...iang.com>
---
 drivers/usb/gadget/function/f_fs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 47cfbe41fdff..7f8e566b1c57 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -1306,9 +1306,7 @@ static void ffs_dmabuf_release(struct kref *ref)
 	struct dma_buf *dmabuf = attach->dmabuf;
 
 	pr_vdebug("FFS DMABUF release\n");
-	dma_resv_lock(dmabuf->resv, NULL);
-	dma_buf_unmap_attachment(attach, priv->sgt, priv->dir);
-	dma_resv_unlock(dmabuf->resv);
+	dma_buf_unmap_attachment_unlocked(attach, priv->sgt, priv->dir);
 
 	dma_buf_detach(attach->dmabuf, attach);
 	dma_buf_put(dmabuf);
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ