diff options
author | Sinclair Yeh <syeh@vmware.com> | 2016-05-24 10:50:23 -0700 |
---|---|---|
committer | Sinclair Yeh <syeh@vmware.com> | 2016-05-25 08:11:48 -0700 |
commit | 60bacf93e32d72341f1166a4761bc7a3eab7286d (patch) | |
tree | 09354edb1bb984d2c49f3966a1bc96900c05d3d5 /vmwgfx_msg.c | |
parent | 2ecb659c8a5e65b3be41ca7f91edee465a6b2ddc (diff) |
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 <syeh@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Diffstat (limited to 'vmwgfx_msg.c')
-rw-r--r-- | vmwgfx_msg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vmwgfx_msg.c b/vmwgfx_msg.c index 9c2bb21..99de10a 100644 --- a/vmwgfx_msg.c +++ b/vmwgfx_msg.c @@ -299,6 +299,9 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg, break; } + if (retries == RETRIES) + return -EINVAL; + *msg_len = reply_len; *msg = reply; |