]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: lustre: return proper error code for libcfs_kkuc_msg_put
authorJames Simmons <jsimmons@infradead.org>
Wed, 23 Dec 2015 21:24:50 +0000 (16:24 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2016 22:20:14 +0000 (14:20 -0800)
The functon libcfs_kkuc_msg_put() returns -ENOSYS which is not
correct. Return -ENXIO instead if the kuc header is corrupt.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/kernelcomm.c

index 46cb81ab3c5f68aa68d1932e55c2669b88c6e0d5..281cfd6c2bc79290d2fe345448e8bee47cadd87c 100644 (file)
@@ -57,14 +57,14 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload)
        ssize_t count = kuch->kuc_msglen;
        loff_t offset = 0;
        mm_segment_t fs;
-       int rc = -ENOSYS;
+       int rc = -ENXIO;
 
        if (!filp || IS_ERR(filp))
                return -EBADF;
 
        if (kuch->kuc_magic != KUC_MAGIC) {
                CERROR("KernelComm: bad magic %x\n", kuch->kuc_magic);
-               return -ENOSYS;
+               return rc;
        }
 
        fs = get_fs();