Message ID | 20190315040415.30631-1-kjlu@umn.edu (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <alsa-devel-bounces@alsa-project.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A25C26C2 for <patchwork-alsa-devel@patchwork.kernel.org>; Sat, 16 Mar 2019 09:37:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 806F72A589 for <patchwork-alsa-devel@patchwork.kernel.org>; Sat, 16 Mar 2019 09:37:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 732EB2AA89; Sat, 16 Mar 2019 09:37:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1CC392A589 for <patchwork-alsa-devel@patchwork.kernel.org>; Sat, 16 Mar 2019 09:37:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 34AC8860; Sat, 16 Mar 2019 10:36:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 34AC8860 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1552729052; bh=u9YI1Z3ZtAaRM2Eyw7tFCsqqmFjwnU3eR9AQYsdQdps=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=VJcITmoqGMEHJxk+jlVczhZMaHrGtxdUL/LtoaZMA76hsbxbDf9MO7l3HzXVesn0s txMfPqgqMkQhB6/LH6unsC7SDSlWYmQQkF6jR47SG0uV+ScE+ek7zCtJFNU1adZ3lZ s2KOXqSjlsPFkVvdnJ/4dQzYBXniFCmMjT7mqnWI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 80F81F89721; Sat, 16 Mar 2019 10:33:55 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 46562F89701; Fri, 15 Mar 2019 05:04:30 +0100 (CET) Received: from mta-p6.oit.umn.edu (mta-p6.oit.umn.edu [134.84.196.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 697D5F89673 for <alsa-devel@alsa-project.org>; Fri, 15 Mar 2019 05:04:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 697D5F89673 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=umn.edu header.i=@umn.edu header.b="ADNMeBmd" Received: from localhost (unknown [127.0.0.1]) by mta-p6.oit.umn.edu (Postfix) with ESMTP id 48C729B4 for <alsa-devel@alsa-project.org>; Fri, 15 Mar 2019 04:04:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p6.oit.umn.edu ([127.0.0.1]) by localhost (mta-p6.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uqKMfSQ-Hzib for <alsa-devel@alsa-project.org>; Thu, 14 Mar 2019 23:04:24 -0500 (CDT) Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p6.oit.umn.edu (Postfix) with ESMTPS id 161039B3 for <alsa-devel@alsa-project.org>; Thu, 14 Mar 2019 23:04:24 -0500 (CDT) Received: by mail-io1-f72.google.com with SMTP id e1so5947383iod.23 for <alsa-devel@alsa-project.org>; Thu, 14 Mar 2019 21:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id; bh=38oI/R5MjfWcJIqTErHvH/1/2Owa3JAlRF9DuY8yntw=; b=ADNMeBmdQ8x2nZ08dZ3jwxtO5L3puFtNfQmMISlilsorBLjBnhMJwJGB4UcFB4xa+m +14rtLVEoOJo9kvavAf4R3td07LHCJiPXBoGEbUvrnHxlw8VXqxe1yFWRmQ0+m8NnBzQ 5Oq7LCF0qZgVX2Y6NkZjd1tg1150Yu2z+jYyXC9Pm0MYogwS1XoWEtu250wsbaFAikEj SfpCPa3YWQFwASHJsI700XH32OqL0YLOkN5sDEVhEtcihBBud5vPr56f2FfmjjKGXZLr kbBBgoP1Rpdtc1PnEnxQVJd1aU8RAmgPiM0PUwyCXFs/IOVY6Y9gnhpk7Z3JfXZl2Pg0 QihQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=38oI/R5MjfWcJIqTErHvH/1/2Owa3JAlRF9DuY8yntw=; b=aN5/n7Q0Yw2F6iLmSXAUt3emtPT8ISVY8rFTWSuW7N0owQiFZ465v9GjqnAVvANLta WFLWYFE9MZL46UKVMjSO4tkDaLDH9gezOUJ3ZJ+Wm/ZzFfY/f+z8v3gf06xEOtVzvhu8 nZopy9L2k8TkF5ORs5qSD8duwsco2Y1iFOtLbtQFVw+w0GSSeTD8ocw6bExy4nLL0X8f wgWY8XmYLT3b1r7Dll5xfHYuIsMfwRV4QPpshfAZODliA4npv0FAEmD+cHljYpUCxBpg 2SvXsU5S9Ft6czY1LRFSdDXDHAtHe00MTKBWnkBw95LM4oR6ArDpHK6PxuzzznvLbYRm MIXQ== X-Gm-Message-State: APjAAAUH+gVlOoUMF/VKP9jSDEXqggoXb444WZvCrK/Y+HzMOa4+lwKM kDh5ZJYpL3yP0X71upKpGK01qo4IMnI20wyZHywjA1sYq4S8XevT5ufyvz4AaNuYp/ynmU1zfOB 1y6i/k7SNnmWUde4cMOKhqAP3VVc= X-Received: by 2002:a5d:8d84:: with SMTP id b4mr893464ioj.109.1552622663636; Thu, 14 Mar 2019 21:04:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcHWFYS1fLUr4rxFpCWWgxcdWmsVlhddNWWAM/IlXnmBnRGjikRheE9pll2s1xfBFTFS8VnQ== X-Received: by 2002:a5d:8d84:: with SMTP id b4mr893449ioj.109.1552622663396; Thu, 14 Mar 2019 21:04:23 -0700 (PDT) Received: from bee.dtc.umn.edu (cs-bee-u.cs.umn.edu. [128.101.106.63]) by smtp.gmail.com with ESMTPSA id v10sm399958iom.45.2019.03.14.21.04.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 21:04:22 -0700 (PDT) From: Kangjie Lu <kjlu@umn.edu> To: kjlu@umn.edu Date: Thu, 14 Mar 2019 23:04:14 -0500 Message-Id: <20190315040415.30631-1-kjlu@umn.edu> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Sat, 16 Mar 2019 10:33:48 +0100 Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.com>, pakki001@umn.edu Subject: [alsa-devel] [PATCH] sound: sb8: add a check for request_region X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" <alsa-devel.alsa-project.org> List-Unsubscribe: <https://mailman.alsa-project.org/mailman/options/alsa-devel>, <mailto:alsa-devel-request@alsa-project.org?subject=unsubscribe> List-Archive: <http://mailman.alsa-project.org/pipermail/alsa-devel/> List-Post: <mailto:alsa-devel@alsa-project.org> List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> List-Subscribe: <https://mailman.alsa-project.org/mailman/listinfo/alsa-devel>, <mailto:alsa-devel-request@alsa-project.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" <alsa-devel-bounces@alsa-project.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
sound: sb8: add a check for request_region
|
expand
|
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index aa2a83eb81a9..dc27a480c2d9 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c @@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev) /* block the 0x388 port to avoid PnP conflicts */ acard->fm_res = request_region(0x388, 4, "SoundBlaster FM"); + if (!acard->fm_res) { + err = -EBUSY; + goto _err; + } if (port[dev] != SNDRV_AUTO_PORT) { if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
In case request_region fails, the fix returns an error code to avoid NULL pointer dereference. Signed-off-by: Kangjie Lu <kjlu@umn.edu> --- sound/isa/sb/sb8.c | 4 ++++ 1 file changed, 4 insertions(+)