mei: fix return value on disconnection
authorTomas Winkler <tomas.winkler@intel.com>
Wed, 22 Jun 2016 21:25:31 +0000 (00:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Aug 2016 12:36:39 +0000 (14:36 +0200)
Correct errno on client disconnection is -ENODEV not -EBUSY

Cc: <stable@vger.kernel.org> #4.3+
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/amthif.c
drivers/misc/mei/bus.c
drivers/misc/mei/main.c

index 14b4541..3cf54ca 100644 (file)
@@ -132,7 +132,7 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
                        return -ERESTARTSYS;
 
                if (!mei_cl_is_connected(cl)) {
-                       rets = -EBUSY;
+                       rets = -ENODEV;
                        goto out;
                }
 
index 63411dd..9c404dc 100644 (file)
@@ -143,7 +143,7 @@ ssize_t __mei_cl_recv(struct mei_cl *cl, u8 *buf, size_t length)
                mutex_lock(&bus->device_lock);
 
                if (!mei_cl_is_connected(cl)) {
-                       rets = -EBUSY;
+                       rets = -ENODEV;
                        goto out;
                }
        }
index 3326bde..d62e89c 100644 (file)
@@ -203,7 +203,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf,
 
                mutex_lock(&dev->device_lock);
                if (!mei_cl_is_connected(cl)) {
-                       rets = -EBUSY;
+                       rets = -ENODEV;
                        goto out;
                }
        }