summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/client.c
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2017-01-27 15:32:41 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-31 11:07:43 +0100
commit7c47d2ca0feca767479329da23523ed798acb854 (patch)
treef03a44bf5f5bdc9fa765de4e94feb9f697210c3b /drivers/misc/mei/client.c
parentmei: bus: unregister callbacks upon me client disable call (diff)
downloadlinux-7c47d2ca0feca767479329da23523ed798acb854.tar.xz
linux-7c47d2ca0feca767479329da23523ed798acb854.zip
mei: return error on notification request to a disconnected client
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>
Diffstat (limited to 'drivers/misc/mei/client.c')
-rw-r--r--drivers/misc/mei/client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 619b4702347f..ecfaef93457d 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -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);