Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1149505pxv; Fri, 9 Jul 2021 19:35:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrqNEWMcdiW9fG2loqVIwS/eX+0CL4a0bgD+fqKb55GTpZtnpK8WVRPOTuvdprtCe2mfnJ X-Received: by 2002:a17:906:698a:: with SMTP id i10mr40415308ejr.499.1625884544768; Fri, 09 Jul 2021 19:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884544; cv=none; d=google.com; s=arc-20160816; b=03kqO7YSorJTESRXmALdHv97GiIqkKy7OcAA5qginrus78QWEvAPOJlRYvq0mwrg3B kSvOvoN6n4x96r4H8V9K7sz0Oai4kzi1X3PCJk8Ib/QcB6jTYpkKUoXrSXMKewoo8gOZ a6hp+3jPBzYFqrrlVlfGCYo9pk+zbgJboa22TYfcaIzMfL0+83Irc/BBaaqzqX3Igm1D gCCi7/Y7CIEzgeFzGdh4drkhv2Xzw0n4iE6KfhJl2E2h64IfOnmaxX99wBJfSmR9EK9v aNQYfsKsaaQ5E4jwq/3eshsHx7NKOkn2PHeTTuZsBOG14sy3e+jbHNagUYnOrH/UXRGV jzNQ== 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=tskJA1NnwFp0+VNd1PfukJBsk7Puk6dCLh4huifGq0k=; b=AOjwrL7wH4q/B80NKU1PAxl5esIKT9Hf2iz1pqk8hM43qXuAjo5G7uXVe//D5guVqN ThKOLgHfdFZ58e54NHqbQPRFbpAP/vdLoUA9q14LZi1WQl5132c4Tv2S5JAZTIYsOy/r aOiSsnEkItuRReO5DUWD3hoHaXXDvT4ug0X3HCSqeqdRZ5mtLfGBXFZOzsXbzlmD4OCQ F8MOCOXjQlIYoDY3slSCl7vF29RzBXmr2pntPUGaCufzePy4h8/c19CVmASPq5Z5upi3 kVfQ0CP1s5ORIBYyuM1qiNhzK+CC3FdL/JGRWhfa2IJKPu0W+N1JzWnTslqxoYdG2v5t rWLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="J/8HuMnz"; 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 m1si9133232edc.121.2021.07.09.19.35.21; Fri, 09 Jul 2021 19:35:44 -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="J/8HuMnz"; 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 S235011AbhGJCe3 (ORCPT + 99 others); Fri, 9 Jul 2021 22:34:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:43064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234602AbhGJC3h (ORCPT ); Fri, 9 Jul 2021 22:29:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A249161402; Sat, 10 Jul 2021 02:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884011; bh=7bQyvyrIOLxHq3iMmmb+Sew8OPmdn8AHueo5G5Hq3gI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J/8HuMnzjR5x4Zc4tvL7D2tfHx6fdJOB7ZaSYQG7vRoIHDiOWkkJzqd2qdG79GtX/ nUCmsugrRoTuymXUAAbjbuPE0Q/Yrulv8NVTdVfwrBt+lT4/KX9wpGPiTVJi0Wg9ty n7CHpiiOiPEAybDaeMvlQp51rMETo/L52p81sbk/j++fIB1l4ba+EmIMdfl+XRoAY7 B43h5osVxu7yg2cjUVoYMq1cFsp/SW2tjnFDdusoAg9d7o8cDyvbuI/hnjSiTxY7M3 BvRxnsymgRnH+JI21pO69f4bRI3Y0GYEk59iOELZB5IyRormRGmpPz240mqY0AH9Fh fVjKbmi5DMObg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiajun Cao , Xin Tan , Thierry Reding , Takashi Iwai , Sasha Levin , alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 83/93] ALSA: hda: Add IRQ check for platform_get_irq() Date: Fri, 9 Jul 2021 22:24:17 -0400 Message-Id: <20210710022428.3169839-83-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-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: Jiajun Cao [ Upstream commit 8c13212443230d03ff25014514ec0d53498c0912 ] The function hda_tegra_first_init() neglects to check the return value after executing platform_get_irq(). hda_tegra_first_init() should check the return value (if negative error number) for errors so as to not pass a negative value to the devm_request_irq(). Fix it by adding a check for the return value irq_id. Signed-off-by: Jiajun Cao Signed-off-by: Xin Tan Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20210622131947.94346-1-jjcao20@fudan.edu.cn Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/hda_tegra.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index 361cf2041911..07787698b973 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -302,6 +302,9 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) const char *sname, *drv_name = "tegra-hda"; struct device_node *np = pdev->dev.of_node; + if (irq_id < 0) + return irq_id; + err = hda_tegra_init_chip(chip, pdev); if (err) return err; -- 2.30.2