aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/format.c')
-rw-r--r--sound/usb/format.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c
index 49e7ec6d2399..1f7a74a77ea3 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -188,7 +188,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;
@@ -362,7 +363,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;