Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4618406pxj; Wed, 12 May 2021 09:21:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6oRH7A3ESba361A/61mM5Jg0fMbSQEEZF18NeSpPJVSMyQc88aZIHkzpj5zC268blvl4m X-Received: by 2002:a17:906:248e:: with SMTP id e14mr37409312ejb.249.1620836465988; Wed, 12 May 2021 09:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836465; cv=none; d=google.com; s=arc-20160816; b=sNN3vUMNVwezpPPg8Le0ZW4DNP7i4BTR9d6iE5wprYW3UkyEiHM/iJ+W5dq+eCo1bT pZ3fr39psLHMfteLQvrE994c0puHycugPvCjoJq2Lv0SgzDIzIzv2G98esreyUWctaJE p7za7uPLsTurEcqQLUVHsH+gEBQGx1Bxa1uG0VNK77qWDl4B+4Hhh6aQtVbS+g+WvkUy 1VRqx7qp2ZkfZ+OxkuobzbnRPJk9Zyaaf7lG9I7sauJrTEhD1yYsheD5Fs3kyhnnI60T LAhVCdCs8UbGT0fZOtsrns3nhAlfJ4ynFkMvBZ0roURON7zSYlp0bMd5hhytXhoe/l8K IIpA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+HED2fIum17vFsY4noyWSFg/Q8f74KhxQnTp0fdeVi4=; b=eH0z3WIA8h8ZtHyHTezruJ5wACLBptzfdUv/UqvYnQN42sbhdB7QwS/ZlQoh+WgRk/ A6vruxl3CiV40cxMGGJEIhnBbmNFjKaqoFzY02KR9RH32rmQwpGjs2u831o5x1sH0mmR /yOs+7i0lG+Nae9RbrvUJ1LM/4ND962UXUsxIhrc7tNC1WI7BNlU9l4gCgdeje3254Xj DBtCkMe93PsBvvSxLwxHp527BWxA78Rnr/+lAVxb19OEecMT1FpxuSkLXj7q1w2VcjQW EIj8Pp+mdKt9b94Mm5RFemQf3cw7vJjseig6aKWxV25E2SQ/C22agzUIsHuIxXdBTa9i Kn/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gQkUQ1hV; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si143093edq.457.2021.05.12.09.20.41; Wed, 12 May 2021 09:21:05 -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=@linuxfoundation.org header.s=korg header.b=gQkUQ1hV; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240354AbhELQRz (ORCPT + 99 others); Wed, 12 May 2021 12:17:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:48504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234976AbhELPfB (ORCPT ); Wed, 12 May 2021 11:35:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1F7DF6195A; Wed, 12 May 2021 15:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832651; bh=5IUdzg3mU8Qx4DC/vAHUfwIBiPaBeLagFUwYjLkCvaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gQkUQ1hV3ItLR7zqjiauB/FJbTHEwrLEkTlOTx/Z4Z831LUoN3cLMxZzoo4JjUxAH Cy612EFw9APGywtHrFpI6M1RiyDL65G5C0lyIPJNOnfzA+DKgMucFIYDJhtFK4+91V cCuvtnaIBmr21Jwz9sUOv5GylqinODuHOh1NIadE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Shtylyov , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 332/530] scsi: jazz_esp: Add IRQ check Date: Wed, 12 May 2021 16:47:22 +0200 Message-Id: <20210512144830.716773523@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sergey Shtylyov [ Upstream commit 38fca15c29db6ed06e894ac194502633e2a7d1fb ] The driver neglects to check the result of platform_get_irq()'s call and blithely passes the negative error codes to request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding the real error code. Stop calling request_irq() with the invalid IRQ #s. Link: https://lore.kernel.org/r/594aa9ae-2215-49f6-f73c-33bd38989912@omprussia.ru Fixes: 352e921f0dd4 ("[SCSI] jazz_esp: converted to use esp_core") Signed-off-by: Sergey Shtylyov Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/jazz_esp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c index f0ed6863cc70..60a88a95a8e2 100644 --- a/drivers/scsi/jazz_esp.c +++ b/drivers/scsi/jazz_esp.c @@ -143,7 +143,9 @@ static int esp_jazz_probe(struct platform_device *dev) if (!esp->command_block) goto fail_unmap_regs; - host->irq = platform_get_irq(dev, 0); + host->irq = err = platform_get_irq(dev, 0); + if (err < 0) + goto fail_unmap_command_block; err = request_irq(host->irq, scsi_esp_intr, IRQF_SHARED, "ESP", esp); if (err < 0) goto fail_unmap_command_block; -- 2.30.2