[PATCH v2] dma-buf: fix stale return value documentation for dma_buf_set_name()

Hung-Chun Tseng <[email protected]>
Newsgroups org.kernel.vger.linux-media,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Commit e73c317efbf9 ("dma-buf: remove restriction of
IOCTL:DMA_BUF_SET_NAME") removed the dma_resv_lock() and the check on
dmabuf->attachments that returned -EBUSY. It updated the description above
the function accordingly, but left the return value description untouched.

dma_buf_set_name() now returns 0 on success, or the error from
strndup_user(); there is no -EBUSY path left. Update the description to
match the code.

kernel-doc does not validate prose, so scripts/kernel-doc does not report
this.

Fixes: e73c317efbf9 ("dma-buf: remove restriction of IOCTL:DMA_BUF_SET_NAME")
Signed-off-by: Hung-Chun Tseng <[email protected]>
---
v2: Add a Fixes: tag identifying the commit that left the return value
    description stale. No change to the diff.

 drivers/dma-buf/dma-buf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index d504c636d..324f4f0c8 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -413,8 +413,8 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
  * @buf:    [in]     A piece of userspace memory that contains the name of
  *                   the dma-buf.
  *
- * Returns 0 on success. If the dma-buf buffer is already attached to
- * devices, return -EBUSY.
+ * Returns 0 on success, or a negative error code from strndup_user() if the
+ * name cannot be copied in.
  *
  */
 static long dma_buf_set_name(struct dma_buf *dmabuf, const char __user *buf)
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.