Skip to content

Commit 3cdb6e2

Browse files
committed
soc: apple: rtkit: Pass 0 as size for a NULL crashlog buffer
The crashlog size is not useful for the crashed() callback callee if the passed buffer is NULL. To reduce the risk of NULL pointer derefences in callees use size 0 in this case. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 0f88fc8 commit 3cdb6e2

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
@@ -394,7 +394,7 @@ static void apple_rtkit_crashlog_rx(struct apple_rtkit *rtk, u64 msg)
394394

395395
rtk->crashed = true;
396396
if (rtk->ops->crashed)
397-
rtk->ops->crashed(rtk->cookie, bfr, rtk->crashlog_buffer.size);
397+
rtk->ops->crashed(rtk->cookie, bfr, bfr ? rtk->crashlog_buffer.size : 0);
398398
}
399399

400400
static void apple_rtkit_ioreport_rx(struct apple_rtkit *rtk, u64 msg)

0 commit comments

Comments
 (0)