From patchwork Sat Oct 17 06:33:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 54490 X-Patchwork-Delegate: kyle@mcmartin.ca Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9H6YI3b010749 for ; Sat, 17 Oct 2009 06:34:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751365AbZJQGdq (ORCPT ); Sat, 17 Oct 2009 02:33:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751190AbZJQGdq (ORCPT ); Sat, 17 Oct 2009 02:33:46 -0400 Received: from mgw1.diku.dk ([130.225.96.91]:59114 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871AbZJQGdp (ORCPT ); Sat, 17 Oct 2009 02:33:45 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 150A052C3DD; Sat, 17 Oct 2009 08:33:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UX44IVqkdJrl; Sat, 17 Oct 2009 08:33:47 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id B0F2D52C3A8; Sat, 17 Oct 2009 08:33:47 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id F1D816DF835; Sat, 17 Oct 2009 08:31:12 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id 97D52F9B0; Sat, 17 Oct 2009 08:33:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 8C06FF810; Sat, 17 Oct 2009 08:33:47 +0200 (CEST) Date: Sat, 17 Oct 2009 08:33:47 +0200 (CEST) From: Julia Lawall To: Kyle McMartin , Jaroslav Kysela , Takashi Iwai , linux-parisc@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 3/14] sound/parisc: Move dereference after NULL test Message-ID: MIME-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c index e924492..f47f9e2 100644 --- a/sound/parisc/harmony.c +++ b/sound/parisc/harmony.c @@ -624,6 +624,9 @@ snd_harmony_pcm_init(struct snd_harmony *h) struct snd_pcm *pcm; int err; + if (snd_BUG_ON(!h)) + return -EINVAL; + harmony_disable_interrupts(h); err = snd_pcm_new(h->card, "harmony", 0, 1, 1, &pcm); @@ -865,11 +868,12 @@ snd_harmony_mixer_reset(struct snd_harmony *h) static int __devinit snd_harmony_mixer_init(struct snd_harmony *h) { - struct snd_card *card = h->card; + struct snd_card *card; int idx, err; if (snd_BUG_ON(!h)) return -EINVAL; + card = h->card; strcpy(card->mixername, "Harmony Gain control interface"); for (idx = 0; idx < HARMONY_CONTROLS; idx++) {