Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9cd9c04 authored by Sinclair Yeh's avatar Sinclair Yeh
Browse files

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: default avatarSinclair Yeh <syeh@vmware.com>
Reviewed-by: default avatarCharmaine Lee <charmainel@vmware.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
parent 81e257e9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;