Skip to contentSkip to conversation

media: venus: Fix uninitialized variable count being checked for zero

PATCH Applied Colin King 2 participants 2 messages Jan 15, 2021 – Mar 1, 2021

Subsystems (5)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 media: venus: Fix uninitialized variable count being checked for zero

From: Colin Ian King <[email protected]>

In the case where plat->codecs is NULL the variable count is uninitialized but is being checked to see if it is 0. Fix this by initializing count to 0.

Addresses-Coverity: ("Uninitialized scalar variable")

Fixes e29929266be1 ("media: venus: Get codecs and capabilities from hfi platform")
---
 drivers/media/platform/qcom/venus/hfi_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_parser.c +1 -1
index 2c63988cb321..7263c0c32695 100644
@@ -232,7 +232,7 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
 {
 	const struct hfi_platform *plat;
 	const struct hfi_plat_caps *caps = NULL;
-	u32 enc_codecs, dec_codecs, count;
+	u32 enc_codecs, dec_codecs, count = 0;
 	unsigned int entries;
 
 	if (inst)
Signature · 1 line
2.29.2
#1 lore raw
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 11 lines · On Fri, 15 Jan 2021 10:11:26 +0000 you wrote:

From: Colin Ian King <[email protected]>

In the case where plat->codecs is NULL the variable count is uninitialized but is being checked to see if it is 0. Fix this by initializing count to 0.

Addresses-Coverity: ("Uninitialized scalar variable")

Fixes e29929266be1 ("media: venus: Get codecs and capabilities from hfi platform")

[...]

Here is the summary with links:
- [next] media: venus: Fix uninitialized variable count being checked for zero

    https://git.kernel.org/qcom/c/c5b14df7a80a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html