Skip to content

Commit 7610bb0

Browse files
committed
Merge branch 'vmwgfx-fixes-5.3' of git://people.freedesktop.org/~thomash/linux into drm-fixes
Single vmwgfx double free fix. Signed-off-by: Dave Airlie <[email protected]>
2 parents b0dfce9 + 08b0c89 commit 7610bb0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_msg.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
353353
!!(HIGH_WORD(ecx) & MESSAGE_STATUS_HB));
354354
if ((HIGH_WORD(ebx) & MESSAGE_STATUS_SUCCESS) == 0) {
355355
kfree(reply);
356-
356+
reply = NULL;
357357
if ((HIGH_WORD(ebx) & MESSAGE_STATUS_CPT) != 0) {
358358
/* A checkpoint occurred. Retry. */
359359
continue;
@@ -377,7 +377,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
377377

378378
if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0) {
379379
kfree(reply);
380-
380+
reply = NULL;
381381
if ((HIGH_WORD(ecx) & MESSAGE_STATUS_CPT) != 0) {
382382
/* A checkpoint occurred. Retry. */
383383
continue;
@@ -389,10 +389,8 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
389389
break;
390390
}
391391

392-
if (retries == RETRIES) {
393-
kfree(reply);
392+
if (!reply)
394393
return -EINVAL;
395-
}
396394

397395
*msg_len = reply_len;
398396
*msg = reply;

0 commit comments

Comments
 (0)