lkml.org 
[lkml]   [2023]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 1/2] ALSA: hda: cs35l41: Do not allow uninitialised variables to be freed
Date
Initialise the variables to NULL so that they cannot be uninitialised
when devm_kfree is called.

Found by static analysis.

Fixes: 8c4c216db8fb ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD")

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
sound/pci/hda/cs35l41_hda_property.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c
index c9eb70290973..73b304e6c83c 100644
--- a/sound/pci/hda/cs35l41_hda_property.c
+++ b/sound/pci/hda/cs35l41_hda_property.c
@@ -77,10 +77,10 @@ static const struct cs35l41_config cs35l41_config_table[] = {
static int cs35l41_add_gpios(struct cs35l41_hda *cs35l41, struct device *physdev, int reset_gpio,
int spkid_gpio, int cs_gpio_index, int num_amps)
{
- struct acpi_gpio_mapping *gpio_mapping;
- struct acpi_gpio_params *reset_gpio_params;
- struct acpi_gpio_params *spkid_gpio_params;
- struct acpi_gpio_params *cs_gpio_params;
+ struct acpi_gpio_mapping *gpio_mapping = NULL;
+ struct acpi_gpio_params *reset_gpio_params = NULL;
+ struct acpi_gpio_params *spkid_gpio_params = NULL;
+ struct acpi_gpio_params *cs_gpio_params = NULL;
unsigned int num_entries = 0;
unsigned int reset_index, spkid_index, csgpio_index;
int i;
--
2.34.1

\
 
 \ /
  Last update: 2023-12-19 17:25    [W:0.550 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site