8 Jan
2016
8 Jan
'16
8:43 a.m.
On Fri, 08 Jan 2016 04:15:03 +0100, Yang, Libin wrote:
@@ -2626,18 +2659,23 @@ static void hdmi_array_free(struct
hdmi_spec *spec)
static void generic_hdmi_free(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec;
- int pin_idx;
int pin_idx, pcm_idx;
if (codec_has_acomp(codec)) snd_hdac_i915_register_notifier(NULL);
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { struct hdmi_spec_per_pin *per_pin = get_pin(spec,
pin_idx);
- cancel_delayed_work_sync(&per_pin->work); eld_proc_free(per_pin);
if (per_pin->acomp_jack)
snd_device_free(codec->card, per_pin-
acomp_jack);
- }
- for (pcm_idx = 0; pcm_idx < spec->pcm_used; pcm_idx++) {
if (spec->dyn_pcm_assign)
snd_device_free(codec->card,
spec->pcm_rec[pcm_idx].jack);
else
spec->pcm_rec[pcm_idx].jack = NULL;
Check whether spec->pcm_rec[pcm_idx].jack is NULL beforehand.
Do you mean: if (spec->pcm_rec[pcm_idx].jack) spec->pcm_rec[pcm_idx].jack = NULL;
Not only that. Calling snd_device_free() with NULL isn't allowed.
Takashi