diff options
author | Sinclair Yeh <syeh@vmware.com> | 2016-06-29 23:31:01 (GMT) |
---|---|---|
committer | Sinclair Yeh <syeh@vmware.com> | 2016-07-01 17:47:47 (GMT) |
commit | a9cd9c044aa90ba2b31d1bf3e3432f38fb1d25fe (patch) | |
tree | 48027336cfde7b01894711086e59caa183156594 /drivers/gpu | |
parent | 81e257e964268d050f8e9188becd44d50f241d72 (diff) | |
download | linux-a9cd9c044aa90ba2b31d1bf3e3432f38fb1d25fe.tar.xz |
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 <syeh@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c index f0374f9..e57a0ba 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c @@ -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; |