Merge branch 'asoc-5.2' into asoc-5.3
[platform/kernel/linux-rpi.git] / sound / soc / soc-dapm.c
index 5fc57af..6b44b4a 100644 (file)
@@ -487,7 +487,8 @@ static int dapm_kcontrol_add_widget(struct snd_kcontrol *kcontrol,
                n = 1;
 
        new_wlist = krealloc(data->wlist,
-                       sizeof(*new_wlist) + sizeof(widget) * n, GFP_KERNEL);
+                            struct_size(new_wlist, widgets, n),
+                            GFP_KERNEL);
        if (!new_wlist)
                return -ENOMEM;
 
@@ -883,6 +884,7 @@ static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
                        case snd_soc_dapm_switch:
                        case snd_soc_dapm_mixer:
                        case snd_soc_dapm_pga:
+                       case snd_soc_dapm_effect:
                        case snd_soc_dapm_out_drv:
                                wname_in_long_name = true;
                                kcname_in_long_name = true;
@@ -2247,7 +2249,7 @@ static int soc_dapm_mux_update_power(struct snd_soc_card *card,
        dapm_kcontrol_for_each_path(path, kcontrol) {
                found = 1;
                /* we now need to match the string in the enum to the path */
-               if (!(strcmp(path->name, e->texts[mux])))
+               if (e && !(strcmp(path->name, e->texts[mux])))
                        connect = true;
                else
                        connect = false;
@@ -2373,6 +2375,7 @@ static ssize_t dapm_widget_show_component(struct snd_soc_component *cmpnt,
                case snd_soc_dapm_dac:
                case snd_soc_dapm_adc:
                case snd_soc_dapm_pga:
+               case snd_soc_dapm_effect:
                case snd_soc_dapm_out_drv:
                case snd_soc_dapm_mixer:
                case snd_soc_dapm_mixer_named_ctl:
@@ -3200,6 +3203,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
                        dapm_new_mux(w);
                        break;
                case snd_soc_dapm_pga:
+               case snd_soc_dapm_effect:
                case snd_soc_dapm_out_drv:
                        dapm_new_pga(w);
                        break;