vsock: fix the error return when an invalid ioctl command is used
authorColin Ian King <colin.king@canonical.com>
Tue, 27 Oct 2020 09:09:42 +0000 (09:09 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 30 Oct 2020 00:43:20 +0000 (17:43 -0700)
Currently when an invalid ioctl command is used the error return
is -EINVAL.  Fix this by returning the correct error -ENOIOCTLCMD.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/vmw_vsock/af_vsock.c

index 9c4cd82..35613ef 100644 (file)
@@ -2072,7 +2072,7 @@ static long vsock_dev_do_ioctl(struct file *filp,
                break;
 
        default:
-               retval = -EINVAL;
+               retval = -ENOIOCTLCMD;
        }
 
        return retval;