Skip to content

Commit

Permalink
drm/vmwgfx: Add a check to handle host message failure
Browse files Browse the repository at this point in the history
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 <syeh@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
  • Loading branch information
Sinclair Yeh committed Jul 1, 2016
1 parent 81e257e commit a9cd9c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a9cd9c0

Please sign in to comment.