From: Jim Meyering Date: Tue, 4 Mar 2008 23:25:11 +0000 (-0800) Subject: USB: usbaudio: handle kcalloc failure X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=ff17e953cb70e37ceb7b487113a0a37441052219;p=openwrt%2Fstaging%2Fblogic.git USB: usbaudio: handle kcalloc failure sound/usb/usbaudio.c (check_hw_params_convention): Handle kcalloc failure. Signed-off-by: Jim Meyering Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 675672f313be..f48838a078cb 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -1762,6 +1762,8 @@ static int check_hw_params_convention(struct snd_usb_substream *subs) channels = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL); rates = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL); + if (!channels || !rates) + goto __out; list_for_each(p, &subs->fmt_list) { struct audioformat *f;