Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1143911pxv; Fri, 9 Jul 2021 19:23:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw61jHkBcQTgdqijcQeWZO8fftkRWAWKTdEigJi4oLQLtcFJsPb1MqXDpAIAIFqSerS1V2R X-Received: by 2002:aa7:da06:: with SMTP id r6mr4560987eds.38.1625883839377; Fri, 09 Jul 2021 19:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883839; cv=none; d=google.com; s=arc-20160816; b=MQAgjBREQp0cII+TgJGl2azW5LK3jLUKfpdLz/JAAluXtp4+nePFpGlFR641iRUw2q 2dKCr9YRfvc7OFoR4tPHPenU3vMHfIlSYoTRUF6wuju/I0YTq0UpiJwbiOGvsFjJbQXY FPOaDrX5fypNTk6cWZRFkogDKXoLo1MFFvT5x8FsNSPBYV9P47Zu3U9IdJIpHiHiCJ9t dE8E5xvdTFHjYMrRq6FUSsowdHjGMrqzh5AUTF3Ev6N4I4KSXFHWuBfqKBr+vJ9vNO43 w7y0OJIvamdYWmi9PFqgtkyx0nhYm1rJD+3DaKVTQOgPo1fV70KcB7bFelyTNMaau5PW oRpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T/DRambtvAUXMH9d6WDtKBvV7X0PPvvfY+kak+Oo98s=; b=IWesJGfGSKbYjwlj0KSBLLbi0GRmhsTXpMsAD8HBEX+LrP/76UMr1xone5bc4Ui+ud MBgja/fv34aBkgBpN/MtTTLaRHqGYsa+cw9FNO4l0gZvg0gmuX7Drf6anLA5kX2xLJ2P dYW4C5WvAsXy8Z0iO0WAEKDVomevv50rnPptqedNVWE+Gdf5zsg8Ft3W2IRspznCo1mn ZDaWragSSX2SC58WfDN89amr3q3l5iSZXq9S9BC7yP+h/v8D1dH7sGw0h1jEYs4SlQnn ebfOK0u0X/isypPu7zByaUX0cB70n7fZPAucR61UW5x7YuzTMBWUqGxKGueHPYOm1sjU oG4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jesDHPTP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy15si9122239edb.173.2021.07.09.19.23.36; Fri, 09 Jul 2021 19:23:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jesDHPTP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232896AbhGJCXO (ORCPT + 99 others); Fri, 9 Jul 2021 22:23:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:38546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232508AbhGJCWG (ORCPT ); Fri, 9 Jul 2021 22:22:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C7920613D6; Sat, 10 Jul 2021 02:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883559; bh=1BWtIQ+bDDju4B6IewjLGl2AaJcRH26LIim6FejbrmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jesDHPTPLQQb75QxNMKYwuQCzUMwURiMNsy6Xz2cc0jgrf8qxSKfqqgEL9+dRn5nk ARCLsh1Jp+xoV9BogWbUen54lZ4VHsamM7IJBDyxTSkY1Lxztz3faTH9cAF8atzTpZ bTaio/Tv6ET3VYz6CSBVq/okIJJ9gDq0Ey3VQNwBwgJ+c1gK7m+DlNS/NgB3kcjE4/ ZUSK+ZTk81UnVs5heZk7GNtP2wHdxajLX4ReqaFBkzMFLfGIkMwMudRVaHs5JfrXcm aUDXh8AZl+rV3xt3FifQc1HlRbyU5njLumnFVRBAr39e4/Zjvas92EWPfMgp6LtTUn ZGbPm92LGcjSg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yang Yingliang , Takashi Iwai , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.13 067/114] ALSA: n64: check return value after calling platform_get_resource() Date: Fri, 9 Jul 2021 22:17:01 -0400 Message-Id: <20210710021748.3167666-67-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710021748.3167666-1-sashal@kernel.org> References: <20210710021748.3167666-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Yingliang [ Upstream commit be471fe332f7f14aa6828010b220d7e6902b91a0 ] It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20210610124958.116142-1-yangyingliang@huawei.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/mips/snd-n64.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/mips/snd-n64.c b/sound/mips/snd-n64.c index e35e93157755..463a6fe589eb 100644 --- a/sound/mips/snd-n64.c +++ b/sound/mips/snd-n64.c @@ -338,6 +338,10 @@ static int __init n64audio_probe(struct platform_device *pdev) strcpy(card->longname, "N64 Audio"); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (!res) { + err = -EINVAL; + goto fail_dma_alloc; + } if (devm_request_irq(&pdev->dev, res->start, n64audio_isr, IRQF_SHARED, "N64 Audio", priv)) { err = -EBUSY; -- 2.30.2