From b2e689c2c7761ce8c40daa2d6d1c7b9e227a30a6 Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Thu, 16 Jul 2020 17:44:56 -0600 Subject: [PATCH] msm: kgsl: Limit the HFI error log to 16 characters The HFI error message has a 16 character error string attached. We should not trust that the error string is properly formatted with a null character at the end. Set the string precision to ensure that we only print up to 16 characters of the payload. Change-Id: Ic0dedbad1b2aebef1feb3f9f7f531869e96599e6 Signed-off-by: Jordan Crouse --- drivers/gpu/msm/adreno_a6xx_hfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/msm/adreno_a6xx_hfi.c b/drivers/gpu/msm/adreno_a6xx_hfi.c index 06bbe3561e04..081eecff19a8 100644 --- a/drivers/gpu/msm/adreno_a6xx_hfi.c +++ b/drivers/gpu/msm/adreno_a6xx_hfi.c @@ -517,7 +517,7 @@ static void receive_err_req(struct a6xx_gmu_device *gmu, void *rcvd) { struct hfi_err_cmd *cmd = rcvd; - dev_err(&gmu->pdev->dev, "HFI Error Received: %d %d %s\n", + dev_err(&gmu->pdev->dev, "HFI Error Received: %d %d %.16s\n", ((cmd->error_code >> 16) & 0xFFFF), (cmd->error_code & 0xFFFF), (char *) cmd->data);