Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1151445pxv; Fri, 9 Jul 2021 19:39:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZO94vMWDzgmoSMJMg6v7h/Q9bnXaZKfuzPPtCxINgf+JS6qgg/UmYQUo8Q4XTXOr7ZoJ4 X-Received: by 2002:a05:6638:2390:: with SMTP id q16mr26671637jat.59.1625884798660; Fri, 09 Jul 2021 19:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884798; cv=none; d=google.com; s=arc-20160816; b=I/+R3PzIoKbDitx2GnjQmkjzMf91UipPPewcHoROK0PgXpp6jwMTD38x36VVTb+y9P EWC2HgKOdUt6wPbZTVvw0UszoV+kQEvU60juhzg4KQkPwaUiAP61+Bg0NcTT51GP0D93 5/k5wWZLvzqRgJLxensIVIi8lZzDwLoMxLtqsuDAoJmps3dky0jWcOfYAV4jXmlLyQcj RhGeKtnIGru20X7L7tIvRo/GfOpDjNWBgdzAFxrcTxk2TV++K8IYE8N4xapBFAC/zOJS 6fc+7eIBnTrDhFwCo2Y4X0OzPmx2Urv5IJkngF+Ph5FJHR4rQLOkmBg/dOPMG1CCwDUu vVBg== 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=8bnDsEhtNQSntrdpho2Y42eMYJbtT5L7xbuMwuk+Ii4=; b=DEAGf/x4zX51BRockB/0KHJPPBxs76h2tDax9UJMsKC4eMBLDiGLZUclUcdy0aO0yx LSZ6cR6qUGUR32Gci0lp6KzhQ4muQCpnIIKhJiodHZFm42rdd/nfvGMRMONdtBD+J5ls vNZ8XBNmHM54LpLS015VCAz5TImeZcywBrNxqgmpiMV5wIUVj+J+ippYzN2N1g6u4JFX biREAMQ0e+4HW79Me71cee/Mg8SXUNsKEJiDPE2kmDE2J0zlW2urEk1wzn0nTSE+iljG AEEgctUPj9Iev8HC0wWHozgTWX28s/1AJJtI1m7QZ8i0jQbOh0PRClrXS/3aVZvksBVc KaDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UeeNOMWT; 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 s21si8184046iow.73.2021.07.09.19.39.46; Fri, 09 Jul 2021 19:39:58 -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=UeeNOMWT; 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 S234001AbhGJCmC (ORCPT + 99 others); Fri, 9 Jul 2021 22:42:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:58372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234915AbhGJCjS (ORCPT ); Fri, 9 Jul 2021 22:39:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18FDA613EE; Sat, 10 Jul 2021 02:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884508; bh=L97dLeP6erxCCovARaRHBZiyyAeRSD+wLyweSRUnot8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UeeNOMWTQMTvWk0JgSxlj6yJyHKsjny+e4Wf+XNMyLIqaT2YCSwiD6iWTQEGK8XtC 408GyObvKqc7BQ2OA3nabFWzJdlmTz/5VAk/UFHbY0NQ0WSA7pv8KeZjjwdtmYEyBy 8qtrcAXQvQ7OYEHUxYFMO0zyJRhEW30Y5d6HMG3Vf0cBSgPXZzCEkZfR9AR2JAmpHT uVIPa2s7l+5Schlxon6AQFOTe8YOVbHAy4hPbvXCnjAIK1TZUoPq7KvBqUy06ydP3c 8vheqkshtgkgApr8Pn6kV94Cv2j6D95gNrIGhMom/zBnWc0sd4UiqGpo0P3aLh39iK 21MoiGpA+E+Bw== 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 4.19 34/39] ALSA: hda: Add IRQ check for platform_get_irq() Date: Fri, 9 Jul 2021 22:31:59 -0400 Message-Id: <20210710023204.3171428-34-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-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 e85fb04ec7be..b567c4bdae00 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -363,6 +363,9 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) unsigned short gcap; int irq_id = platform_get_irq(pdev, 0); + if (irq_id < 0) + return irq_id; + err = hda_tegra_init_chip(chip, pdev); if (err) return err; -- 2.30.2