Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1147298pxv; Fri, 9 Jul 2021 19:31:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/YUzH/Y1deAxG1HJuD4rTEeO1gYypIzmEdur9CXqe/r7JLC+X/PeM//cdElTt8A5+36fY X-Received: by 2002:a05:6402:64e:: with SMTP id u14mr13566780edx.122.1625884270442; Fri, 09 Jul 2021 19:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884270; cv=none; d=google.com; s=arc-20160816; b=sCXvJL70DPrgUSTXQ8GVs/uTvFgAfpWzchf9NbxA61OcIBlrP4iVEv2YRJ2a1EAuUm //TRlOZrb7KRmow7BslgKYdK6CqQh4qL11d2RZ8PgTv2x8YWTmo8NTpO2i7awjqYi7so wB8rH4DfqghABiVS/SGekszkjWYtegpoC0CClh8MgDDroIyQHPa/o6qtSiEmUaRvorm6 VG+28GBPdF5ckqITonlqjTF1GbiqwTb8LqZq8K1ZVjHuh6tmMVfXglMndJsaLge65GnC n6JVJKhyIP5OO6rwens9FSX/cOGRURuD/9K3sqTg33hlbamqM5QyYxDMzKTOeko2vmxs uxKA== 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=HN1O2zMuO8Pun5jpefdi+dTNkr5+kxr8aZepa5PU6YQ=; b=F+vqA5kT3nqGWb9YivXmiX8BgLFvpfL/2PYOA1KDQZ8kXkOHGYKA4s03aFbrLdEqgg 8Tjo112TC3JFAXPjv0afNIOEBLYcdLKCdeUnpZjI80gjBxapbuvDSebZnGcscjc5NeQJ t/x8xXF821e7XZc1sJY4DvIwzubltre76ar+tlBJrZfHNoBuvB9tcDovWuZvt/N0eQk6 fK9YDYOg0clE2J8+NYSsXYYagTiym9fPxQFoGcTfaIPModDRWIRpVhoZPaKWiEmF2e5t Rzk9xJkpQQ00jNphA/jlw4OGUSM4VQDLKoxfPN0yC9z34HkCOLVUJzu9pErxwhYE7eB+ fPnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nV4F1bcd; 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 r11si5709662eja.61.2021.07.09.19.30.46; Fri, 09 Jul 2021 19:31:10 -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=nV4F1bcd; 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 S234068AbhGJC3E (ORCPT + 99 others); Fri, 9 Jul 2021 22:29:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:43262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233711AbhGJC1E (ORCPT ); Fri, 9 Jul 2021 22:27:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 34891613F8; Sat, 10 Jul 2021 02:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883851; bh=BBIWsxldfa1/BlZAXDvliQuDJ1M4egHfyUxTTQQcEcA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nV4F1bcdaJwGkqh8A4pbZFe21Dy55UmhF5+RsD1jSmsyPMw8kMeqJaKG5UFapTity kaqIoXCt2xyXxFicFrHVyrTVWg5hvKzHqWO2G0U8lEh1/O0GSCJevIUaO3HKuiA88+ YvoHXpiSBZnucfz6nB8e1tg5oYm1iAnsNc+9xWgZpj7KpCslo67iNdHwzcQrRn0aY6 1vGr3+iEI6Yyk1wk+JhmqGUJOVEVPBWFeVSYqwDqbLWDbKF4gRwN4bZmv2zJMvnBJZ n67bkrTY4bDbHJfgVIuIiuo8tyTpdTvV14+V4v+5apk7aL+UwFCiQsrmWtzWfkTEM1 LZTbHJ6ChzBqQ== 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.12 094/104] ALSA: hda: Add IRQ check for platform_get_irq() Date: Fri, 9 Jul 2021 22:21:46 -0400 Message-Id: <20210710022156.3168825-94-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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 6f2b743b9d75..6c6dc3fcde60 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -262,6 +262,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