lkml.org 
[lkml]   [2021]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] USB: gadget: f_fs: Remove unneed cast in ffs_prepare_buffer()
Date
A coccicheck run provided information like the following.

./drivers/usb/gadget/function/f_fs.c:3832:9-16:
WARNING: ERR_CAST can be used with data

ffs_prepare_buffer() should return an ERR_PTR() encoded error
code on failure.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/usb/gadget/function/f_fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index bf109191659a..cb419bbd089c 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -3829,7 +3829,7 @@ static char *ffs_prepare_buffer(const char __user *buf, size_t len)

data = memdup_user(buf, len);
if (IS_ERR(data))
- return ERR_PTR(PTR_ERR(data));
+ return data;

pr_vdebug("Buffer from user space:\n");
ffs_dump_mem("", data, len);
--
2.17.1
\
 
 \ /
  Last update: 2021-05-29 14:06    [W:0.084 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site