Skip to content

Commit 6022188

Browse files
committed
drm: apple: afk: Clear commands before sending them
Signed-off-by: Hector Martin <[email protected]>
1 parent 69ee5c1 commit 6022188

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • drivers/gpu/drm/apple

drivers/gpu/drm/apple/afk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ int afk_send_command(struct apple_epic_service *service, u8 type,
859859

860860
memcpy(txbuf, payload, payload_len);
861861

862+
memset(&cmd, 0, sizeof(cmd));
862863
cmd.retcode = cpu_to_le32(0);
863864
cmd.rxbuf = cpu_to_le64(rxbuf_dma);
864865
cmd.rxlen = cpu_to_le32(output_len);
@@ -949,6 +950,8 @@ int afk_service_call(struct apple_epic_service *service, u16 group, u32 command,
949950
return -ENOMEM;
950951

951952
call = bfr;
953+
954+
memset(call, 0, sizeof(*call));
952955
call->group = cpu_to_le16(group);
953956
call->command = cpu_to_le32(command);
954957
call->data_len = cpu_to_le32(data_len + data_pad);

0 commit comments

Comments
 (0)