From: Clemens Ladisch Date: Mon, 16 Jun 2008 12:13:52 +0000 (+0200) Subject: sound: oxygen: fix NULL pointer dereference when loading snd-oxygen X-Git-Tag: v2.6.26-rc7~28^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f9115d880ca550922434aee05ca18796c58eb99;p=linux-2.6 sound: oxygen: fix NULL pointer dereference when loading snd-oxygen Check that model->control_filter is set before trying to call it. Signed-off-by: Clemens Ladisch Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index cc0cddadd5..6facac5aed 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c @@ -936,11 +936,13 @@ static int add_controls(struct oxygen *chip, for (i = 0; i < count; ++i) { template = controls[i]; - err = chip->model->control_filter(&template); - if (err < 0) - return err; - if (err == 1) - continue; + if (chip->model->control_filter) { + err = chip->model->control_filter(&template); + if (err < 0) + return err; + if (err == 1) + continue; + } if (!strcmp(template.name, "Master Playback Volume") && chip->model->dac_tlv) { template.tlv.p = chip->model->dac_tlv;