diff options
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r-- | drivers/misc/mei/main.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 173ff095be0d..cabeddd66c1f 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -249,19 +249,16 @@ static ssize_t mei_read(struct file *file, char __user *ubuf, | |||
249 | mutex_unlock(&dev->device_lock); | 249 | mutex_unlock(&dev->device_lock); |
250 | 250 | ||
251 | if (wait_event_interruptible(cl->rx_wait, | 251 | if (wait_event_interruptible(cl->rx_wait, |
252 | (MEI_READ_COMPLETE == cl->reading_state || | 252 | MEI_READ_COMPLETE == cl->reading_state || |
253 | MEI_FILE_INITIALIZING == cl->state || | 253 | mei_cl_is_transitioning(cl))) { |
254 | MEI_FILE_DISCONNECTED == cl->state || | 254 | |
255 | MEI_FILE_DISCONNECTING == cl->state))) { | ||
256 | if (signal_pending(current)) | 255 | if (signal_pending(current)) |
257 | return -EINTR; | 256 | return -EINTR; |
258 | return -ERESTARTSYS; | 257 | return -ERESTARTSYS; |
259 | } | 258 | } |
260 | 259 | ||
261 | mutex_lock(&dev->device_lock); | 260 | mutex_lock(&dev->device_lock); |
262 | if (MEI_FILE_INITIALIZING == cl->state || | 261 | if (mei_cl_is_transitioning(cl)) { |
263 | MEI_FILE_DISCONNECTED == cl->state || | ||
264 | MEI_FILE_DISCONNECTING == cl->state) { | ||
265 | rets = -EBUSY; | 262 | rets = -EBUSY; |
266 | goto out; | 263 | goto out; |
267 | } | 264 | } |