Browse Source

mei: reset client connection state on timeout

On connection timeout we leave the connecting client in
connecting state. Since a new connection is stalled till
previous connection is completed in this case no new connection
is possible till the user space does release the file handle.
Therefore on timeout we move the client to disconnected state.

Cc: stable@vger.kernel.org # 3.15+
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>
Alexander Usyskin 11 years ago
parent
commit
3e37ebb718
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/misc/mei/client.c

+ 1 - 0
drivers/misc/mei/client.c

@@ -616,6 +616,7 @@ int mei_cl_connect(struct mei_cl *cl, struct file *file)
 	mutex_lock(&dev->device_lock);
 	mutex_lock(&dev->device_lock);
 
 
 	if (cl->state != MEI_FILE_CONNECTED) {
 	if (cl->state != MEI_FILE_CONNECTED) {
+		cl->state = MEI_FILE_DISCONNECTED;
 		/* something went really wrong */
 		/* something went really wrong */
 		if (!cl->status)
 		if (!cl->status)
 			cl->status = -EFAULT;
 			cl->status = -EFAULT;