Skip to content

Commit a9cd9c0

Browse files
author
Sinclair Yeh
committed
drm/vmwgfx: Add a check to handle host message failure
Discovered by static code analysis tool. If for some reason communication with the host fails more than preset number of retries, return an error instead of return garbage. Signed-off-by: Sinclair Yeh <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reported-by: Dan Carpenter <[email protected]>
1 parent 81e257e commit a9cd9c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_msg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
300300
break;
301301
}
302302

303+
if (retries == RETRIES)
304+
return -EINVAL;
305+
303306
*msg_len = reply_len;
304307
*msg = reply;
305308

0 commit comments

Comments
 (0)