Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp885371yba; Thu, 18 Apr 2019 11:11:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9b1/TmHIQfDF7Bkh0Tkf0VqWsJnvEiYnEKq19auQx+JSsZnU5EJArVwLBtR2wQKIce1FJ X-Received: by 2002:a63:1918:: with SMTP id z24mr86058352pgl.406.1555611090672; Thu, 18 Apr 2019 11:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611090; cv=none; d=google.com; s=arc-20160816; b=ZXguHdA1/5XKcYTuw8jLarx1UPmU7/EuFFsiyw9UNftP5DMkcUPinwxd2AjvjpzP5A 228zWYbRNhBIxP7RpkgUbPEr/eNKKmdpo/2owELclCRw+QNeLSLw+txj14vO8nOP8MS/ KjXpzE3ktksgHuTA+Ul8k3IkoMiz0NOAqv8XpYj/brK1zW8A0N7tBfMNgown2rjy9oMk 47m01Oo74TwPMuQ+QzhreparcXo3tlcGsBKLmPgz8R/HhQhyx13B50W/TujQEi6Q4adP 1OpR3UctNUQrgX9wwe3UUiurkNXsGnmT01O1KdskUlXC8/1ZK2FgDfMogC/2oruGoq8w 61yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=38fTUmVBLKlHvi2qaF0SOQKwglTFFtCdnNl7/csUlGU=; b=uUx+AayOePwIx8e2h1yuP6xzPV3f2rZNkYPsqUZU8IMQ167+HYHISzMcW/pq7DxuNd SvDubu8wP0lczg6r6jkmUD0fRubYyJbNA9ebrdMcrADDlW30dV+X9uOju/iE+XBYoazt ELQGxXqqeLrSVfB8fTWOt26gqtw8fDtUKU8N2gAJrZNDAK7/RIJn9VQzr8URJXvt4qhl mUJ068vvHVTQyTSQDSemob9IHw2f7At5SiAwasCPwmzSnAaWQyhXOIey6DJn7ug/SqMo F1jbUKyMLPOOMH3+3tF6PjN7C1svADJARqCAkzhUcSzsBLOuM8t5bTF4gsjOg1ly6GSJ MiVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="T/xO+/0W"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g127si2505148pgc.135.2019.04.18.11.11.15; Thu, 18 Apr 2019 11:11:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="T/xO+/0W"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391398AbfDRSJh (ORCPT + 99 others); Thu, 18 Apr 2019 14:09:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:41232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404034AbfDRSJf (ORCPT ); Thu, 18 Apr 2019 14:09:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48E5F20652; Thu, 18 Apr 2019 18:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610974; bh=3e9iaK1NdEqCCMOCMT6b7kwJCt0ejbGbBUhp04VCO6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T/xO+/0WnxVwwN/LmJpONy5qtD14H39dl/bbc9M1g40a8COBfpiEu31xyphxdf5N5 PuadkpQMBsiSEuIQZcByxTv/zlu/etpgZv80jho/bY5PSHJnFKZPqEbB1PPpdOKAi6 HZazM5YYVSFnIwuL5jDcyoryKWVqBkhMlyJKwhgY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kangjie Lu , Takashi Iwai , Sasha Levin Subject: [PATCH 5.0 11/93] ALSA: sb8: add a check for request_region Date: Thu, 18 Apr 2019 19:56:49 +0200 Message-Id: <20190418160438.054824327@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit dcd0feac9bab901d5739de51b3f69840851f8919 ] In case request_region fails, the fix returns an error code to avoid NULL pointer dereference. Signed-off-by: Kangjie Lu Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/isa/sb/sb8.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index d77dcba276b5..1eb8b61a185b 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], -- 2.19.1