Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936345Ab0GSQAc (ORCPT ); Mon, 19 Jul 2010 12:00:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48483 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936335Ab0GSQAa (ORCPT ); Mon, 19 Jul 2010 12:00:30 -0400 Date: Mon, 19 Jul 2010 18:00:29 +0200 Message-ID: From: Takashi Iwai To: Kulikov Vasiliy Cc: kernel-janitors@vger.kernel.org, Jaroslav Kysela , Alexey Dobriyan , Dan Carpenter , Andy Shevchenko , Roel Kluin , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH 12/15] pci: riptide: check kzalloc() result In-Reply-To: <1279296959-25227-1-git-send-email-segooon@gmail.com> References: <1279296959-25227-1-git-send-email-segooon@gmail.com> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1521 Lines: 50 At Fri, 16 Jul 2010 20:15:59 +0400, Kulikov Vasiliy wrote: > > If kzalloc() fails exit with -ENOMEM. > > Signed-off-by: Kulikov Vasiliy Thanks, applied now. Takashi > --- > sound/pci/riptide/riptide.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c > index 59d7996..f64fb7d 100644 > --- a/sound/pci/riptide/riptide.c > +++ b/sound/pci/riptide/riptide.c > @@ -1615,7 +1615,10 @@ static int snd_riptide_playback_open(struct snd_pcm_substream *substream) > > chip->playback_substream[sub_num] = substream; > runtime->hw = snd_riptide_playback; > + > data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); > + if (data == NULL) > + return -ENOMEM; > data->paths = lbus_play_paths[sub_num]; > data->id = play_ids[sub_num]; > data->source = play_sources[sub_num]; > @@ -1635,7 +1638,10 @@ static int snd_riptide_capture_open(struct snd_pcm_substream *substream) > > chip->capture_substream = substream; > runtime->hw = snd_riptide_capture; > + > data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); > + if (data == NULL) > + return -ENOMEM; > data->paths = lbus_rec_path; > data->id = PADC; > data->source = ACLNK2PADC; > -- > 1.7.0.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/