Skip to content

Commit ed7326a

Browse files
Stefan Bindingtiwai
authored andcommitted
ALSA: hda: cs35l41: Do not allow uninitialised variables to be freed
Initialise the variables to NULL so that they cannot be uninitialised when devm_kfree is called. Found by static analysis. Fixes: 8c4c216 ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD") Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231219162232.790358-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 092a136 commit ed7326a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sound/pci/hda/cs35l41_hda_property.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ static const struct cs35l41_config cs35l41_config_table[] = {
7777
static int cs35l41_add_gpios(struct cs35l41_hda *cs35l41, struct device *physdev, int reset_gpio,
7878
int spkid_gpio, int cs_gpio_index, int num_amps)
7979
{
80-
struct acpi_gpio_mapping *gpio_mapping;
81-
struct acpi_gpio_params *reset_gpio_params;
82-
struct acpi_gpio_params *spkid_gpio_params;
83-
struct acpi_gpio_params *cs_gpio_params;
80+
struct acpi_gpio_mapping *gpio_mapping = NULL;
81+
struct acpi_gpio_params *reset_gpio_params = NULL;
82+
struct acpi_gpio_params *spkid_gpio_params = NULL;
83+
struct acpi_gpio_params *cs_gpio_params = NULL;
8484
unsigned int num_entries = 0;
8585
unsigned int reset_index, spkid_index, csgpio_index;
8686
int i;

0 commit comments

Comments
 (0)