Skip to content

Commit 27cea5a

Browse files
committed
soc: apple: rtkit: Cut syslog messages after the first '\0'
Certain messages from DCP contain NUL bytes in the random data after the NUL terminated syslog message. Since the syslog message ends with '\n' this results in a dev_info() message terminated with two newlines and an empty printed line in the kernel log. Signed-off-by: Janne Grunau <[email protected]>
1 parent 550fa57 commit 27cea5a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/soc/apple/rtkit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static void apple_rtkit_syslog_rx_log(struct apple_rtkit *rtk, u64 msg)
476476

477477
log_context[sizeof(log_context) - 1] = 0;
478478

479-
msglen = rtk->syslog_msg_size - 1;
479+
msglen = strnlen(rtk->syslog_msg_buffer, rtk->syslog_msg_size - 1);
480480
while (msglen > 0 &&
481481
should_crop_syslog_char(rtk->syslog_msg_buffer[msglen - 1]))
482482
msglen--;

0 commit comments

Comments
 (0)