staging: vme_user: Fix the issue of return the wrong error code
authorPiro Yang <piroyangg@gmail.com>
Tue, 19 Dec 2023 17:04:47 +0000 (01:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 13:08:38 +0000 (14:08 +0100)
Fix the issue of returning the -ENOSYS error code when an error occurs.

The error code of -ENOSYS indicates Invalid system call number, but
there is not system call error. So replace -ENOSYS error code by the
return -EINVAL error code.

Signed-off-by: Piro Yang <piroyangg@gmail.com>
Link: https://lore.kernel.org/r/20231219170447.51237-1-piroyangg@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vme_user/vme.c

index 5c416c31ec5766fc5d836364446e9671f380b7a8..9bc2d35405af6110bbb69e36757a15153b237de6 100644 (file)
@@ -341,7 +341,7 @@ int vme_slave_set(struct vme_resource *resource, int enabled,
 
        if (!bridge->slave_set) {
                dev_err(bridge->parent, "Function not supported\n");
-               return -ENOSYS;
+               return -EINVAL;
        }
 
        if (!(((image->address_attr & aspace) == aspace) &&