]> git.hungrycats.org Git - linux/commitdiff
mei: return error on notification request to a disconnected client
authorAlexander Usyskin <alexander.usyskin@intel.com>
Sat, 7 Oct 2017 22:36:56 +0000 (22:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2017 09:08:36 +0000 (10:08 +0100)
[ Upstream commit 7c47d2ca0feca767479329da23523ed798acb854 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/client.c

index e2af61f7e3b659aebebc25409c9ff75a64010038..451d417eb451739b15fd5f5fb90f64b1bfdb12f7 100644 (file)
@@ -1320,6 +1320,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);