usb: gadget: remove useless cast
authorSalah Triki <salah.triki@gmail.com>
Sat, 31 Jul 2021 17:18:38 +0000 (18:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Aug 2021 10:31:27 +0000 (12:31 +0200)
Remove the cast done by ERR_PTR() and PTR_ERR() since data is of type char
* and fss_prepare_buffer() should returns a value of this type.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Salah Triki <salah.triki@gmail.com>
Link: https://lore.kernel.org/r/20210731171838.GA912463@pc
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_fs.c

index cc9a11b..8260f38 100644 (file)
@@ -3831,7 +3831,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);