mei: return error on notification request to a disconnected client
authorAlexander Usyskin <alexander.usyskin@intel.com>
Fri, 27 Jan 2017 14:32:41 +0000 (16:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Jan 2017 10:07:43 +0000 (11:07 +0100)
Request for a notification from a disconnected client will be ignored
silently by the FW but the caller should know that the operation hasn't
succeeded.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/client.c

index 619b4702347f8a528a28e4040bb26d1dfde43a2b..ecfaef93457d9b3b2af871c21d93658437173b59 100644 (file)
@@ -1331,6 +1331,9 @@ int mei_cl_notify_request(struct mei_cl *cl,
                return -EOPNOTSUPP;
        }
 
+       if (!mei_cl_is_connected(cl))
+               return -ENODEV;
+
        rets = pm_runtime_get(dev->dev);
        if (rets < 0 && rets != -EINPROGRESS) {
                pm_runtime_put_noidle(dev->dev);