From patchwork Wed Mar 2 11:40:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8480271 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 26A4B9F314 for ; Wed, 2 Mar 2016 11:41:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5810A2035E for ; Wed, 2 Mar 2016 11:41:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 15EE0202E5 for ; Wed, 2 Mar 2016 11:41:03 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 58697261584; Wed, 2 Mar 2016 12:41:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 05A37265262; Wed, 2 Mar 2016 12:40:53 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B66452651E4; Wed, 2 Mar 2016 12:40:50 +0100 (CET) Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by alsa0.perex.cz (Postfix) with ESMTP id E51D02651AC for ; Wed, 2 Mar 2016 12:40:41 +0100 (CET) Received: by mail-pf0-f174.google.com with SMTP id 4so54261888pfd.1 for ; Wed, 02 Mar 2016 03:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=9Lax7J+xurptuv04khYBYhG+zU10gwJyC01P7JYM5l8=; b=aBS9PuQAXS3d0ymdA7KZN2lxWtjWZpyxK/EUjvGuVwfnUStSOr7uvltMDCTJMAIoom 7aPAR8TsqhhV8ZOohlxSpDhRcPSVmz0LMRnlCilDnko8hvnyNqIacCujuSBHPcHwuR9n A24WS9SVkK1+F+lvJKguagAvmbjAgIcmsdMvdB1TWKPByJ9hX+XKtnQTXZAgBZKXVYQ2 Xm5nOsWQeFA9K8+7nZtyiIWCrpwkXqz+PP6OxtVHkN6EUuKTcKFZGWVbjn0P5MH+3Wj/ yGHtGZJN1JJszs7A6x0138TpMAVDBOUrBQPMVL9W/DIbEmQXShbB/UT3VEn6u8pVVcFA p0Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9Lax7J+xurptuv04khYBYhG+zU10gwJyC01P7JYM5l8=; b=mDo+hyTVpbgX7xyhQNX9wkiZj29dIcLmSjvIpp8WyFA5OXkcv+rtIyNxAhzJmAll3f vYtNktOBtsi0cEvsk4YjarEciphhoxNhN6N/bPY1eJ54WXjbZBYHat1bi2pKHuckEP/a t9N/H/dpgiG9JxkEIp1AjnBY+vKHZRT0UsVhCBEkr+T4bItfe37osZuDH4d0TdKlGlPT SgPQRnVCqvJA8PGA+oSBTgZUVDh5qpm6GfHYPnKoFFKc3d8UkC4eD8q3tCj362iZnsOs lL8bchdKdLZBHX2GAl9l+D5aiRxsyw+4QXpIvwffLMf++b7IeStSu1I+QErIaidzPrBo 2pnQ== X-Gm-Message-State: AD7BkJIMVi7AgooVKS/rucUvU4b5DmIs0SSm/lcHeQnjuqIyHM+og8T9wWh0H+rnh51EZw== X-Received: by 10.98.75.8 with SMTP id y8mr10271139pfa.126.1456918839288; Wed, 02 Mar 2016 03:40:39 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([14.195.226.115]) by smtp.gmail.com with ESMTPSA id n66sm4720925pfj.39.2016.03.02.03.40.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Mar 2016 03:40:38 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Wed, 2 Mar 2016 17:10:30 +0530 Message-Id: <1456918830-2675-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [alsa-devel] [PATCH] ALSA: portman2x4: fix NULL pointer dereference X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP While registering pardev, the irq_func was also registered. As a result when we tried to probe for the card, an interrupt was generated and in the ISR we tried to dereference private_data. But private_data is still NULL as we have not yet done portman_create(). Lets probe for the device after card is created. Fixes: e6a1b7e88046 ("ALSA: portman2x4 - use new parport device model") Signed-off-by: Sudip Mukherjee --- sound/drivers/portman2x4.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index 362533f..189e3e7 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -762,11 +762,6 @@ static int snd_portman_probe(struct platform_device *pdev) err = -EIO; goto free_pardev; } - err = portman_probe(p); - if (err) { - err = -EIO; - goto release_pardev; - } if ((err = portman_create(card, pardev, &pm)) < 0) { snd_printd("Cannot create main component\n"); @@ -774,6 +769,12 @@ static int snd_portman_probe(struct platform_device *pdev) } card->private_data = pm; card->private_free = snd_portman_card_private_free; + + err = portman_probe(p); + if (err) { + err = -EIO; + goto __err; + } if ((err = snd_portman_rawmidi_create(card)) < 0) { snd_printd("Creating Rawmidi component failed\n");