Skip to content

Commit 46f9913

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 f0b8c42 commit 46f9913

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

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

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

0 commit comments

Comments
 (0)