mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
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]>
This commit is contained in:
@@ -300,6 +300,9 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
|
||||
break;
|
||||
}
|
||||
|
||||
if (retries == RETRIES)
|
||||
return -EINVAL;
|
||||
|
||||
*msg_len = reply_len;
|
||||
*msg = reply;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user