Merge tag 'sound-fix-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[platform/kernel/linux-rpi.git] / sound / usb / format.c
index 0a2a27f..fd13ac1 100644 (file)
@@ -191,7 +191,8 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof
                 */
                int r, idx;
 
-               fp->rate_table = kmalloc(sizeof(int) * nr_rates, GFP_KERNEL);
+               fp->rate_table = kmalloc_array(nr_rates, sizeof(int),
+                                              GFP_KERNEL);
                if (fp->rate_table == NULL)
                        return -ENOMEM;
 
@@ -365,7 +366,7 @@ static int parse_audio_format_rates_v2v3(struct snd_usb_audio *chip,
                goto err_free;
        }
 
-       fp->rate_table = kmalloc(sizeof(int) * fp->nr_rates, GFP_KERNEL);
+       fp->rate_table = kmalloc_array(fp->nr_rates, sizeof(int), GFP_KERNEL);
        if (!fp->rate_table) {
                ret = -ENOMEM;
                goto err_free;