Skip to content

Commit

Permalink
ALSA: hda/ca0132 - Fix memory leak at error path
Browse files Browse the repository at this point in the history
The CA0132 codec driver doesn't call the free function at its error
path of the probe, which leaves the allocated memory.  Call
ca0132_free() properly at the error handling.

Fixes: a73d511 ("ALSA: hda/ca0132: Add unsol handler for DSP and jack detection")
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Sep 4, 2017
1 parent 284b4c9 commit cc91cea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/pci/hda/patch_ca0132.c
Original file line number Diff line number Diff line change
Expand Up @@ -4774,13 +4774,17 @@ static int patch_ca0132(struct hda_codec *codec)

err = ca0132_prepare_verbs(codec);
if (err < 0)
return err;
goto error;

err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL);
if (err < 0)
return err;
goto error;

return 0;

error:
ca0132_free(codec);
return err;
}

/*
Expand Down

0 comments on commit cc91cea

Please sign in to comment.