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 14b454143c817e90569aa30c0c9fd25fddf56029..3cf54ca051ea3b5a50ad64585deaf242ff791bfe 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 63411ddfb83d6bc901f14e8c01ee729af81c8260..9c404dc8eadac540c353e192da163ae142a0de73 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 3326bde7fba14c1c40eb2242b10c5c7fa23bfb30..d62e89c80beb6b0690743ba88d05d7c9630f1170 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;
                }
        }