RDMA/uverbs: Return not supported error code for unsupported commands
authorLeon Romanovsky <leonro@mellanox.com>
Wed, 21 Feb 2018 16:12:35 +0000 (18:12 +0200)
committerDoug Ledford <dledford@redhat.com>
Fri, 23 Feb 2018 03:29:11 +0000 (22:29 -0500)
Command that doesn't exist means that it is not supported,
so update code to return -EOPNOTSUPP in case of failure.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_main.c

index 2189a26..8d1547f 100644 (file)
@@ -714,7 +714,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
        }
 
        if (!verify_command_idx(command, extended_command)) {
-               ret = -EINVAL;
+               ret = -EOPNOTSUPP;
                goto out;
        }