Skip to content

Commit 2ed6a8e

Browse files
committed
drm: apple: dptxep: Fix reply size check
Signed-off-by: Hector Martin <[email protected]>
1 parent 30d563a commit 2ed6a8e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/apple/dptxep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ dptxport_call_activate(struct apple_epic_service *service,
377377
phy_set_mode_ext(dptx->atcphy, PHY_MODE_DP, dcp->index);
378378

379379
memcpy(reply, data, min(reply_size, data_size));
380-
if (reply_size > 4)
380+
if (reply_size >= 4)
381381
memset(reply, 0, 4);
382382

383383
return 0;
@@ -430,7 +430,7 @@ static int dptxport_call(struct apple_epic_service *service, u32 idx,
430430
case DPTX_APCALL_SET_DRIVE_SETTINGS:
431431
case DPTX_APCALL_GET_DRIVE_SETTINGS:
432432
memcpy(reply, data, min(reply_size, data_size));
433-
if (reply_size > 4)
433+
if (reply_size >= 4)
434434
memset(reply, 0, 4);
435435
return 0;
436436
}

0 commit comments

Comments
 (0)