From ee9fd4d7b2d10659f22cd287a770364fd6ab0ceb Mon Sep 17 00:00:00 2001 From: SarahW Date: Sun, 8 Jan 2017 15:17:57 +0000 Subject: [PATCH] Fixed structure packing and reported data length in the ATAPI Get Event Status Notification command --- src/ide.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ide.c b/src/ide.c index dbfd0e7..48ed363 100644 --- a/src/ide.c +++ b/src/ide.c @@ -2288,7 +2288,7 @@ static void atapicommand(int ide_board) alloc_length = len; { - struct + struct __attribute__((__packed__)) { uint8_t opcode; uint8_t polled; @@ -2299,7 +2299,7 @@ static void atapicommand(int ide_board) uint8_t control; } *gesn_cdb; - struct + struct __attribute__((__packed__)) { uint16_t len; uint8_t notification_class; @@ -2359,6 +2359,7 @@ static void atapicommand(int ide_board) gesn_event_header->notification_class = 0x80; /* No event available */ used_len = sizeof(*gesn_event_header); } + len = used_len; gesn_event_header->len = used_len - sizeof(*gesn_event_header); }