greybus: audio: Fix widget pointer update during control parsing
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Tue, 29 Mar 2016 11:02:35 +0000 (16:32 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 31 Mar 2016 17:19:57 +0000 (10:19 -0700)
widget pointer was incorrectly modfied while parsing kcontrol

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio_topology.c

index 4901348..9e36fb2 100644 (file)
@@ -834,7 +834,7 @@ static int gbaudio_tplg_process_widgets(struct gbaudio_module_info *module,
                list_add(&widget->list, &module->widget_list);
                ncontrols = curr->ncontrols;
                curr++;
-               curr += ncontrols * sizeof(struct gb_audio_control);
+               curr = (void *)curr + ncontrols*sizeof(struct gb_audio_control);
        }
        module->dapm_widgets = dapm_widgets;