Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4618397pxj; Wed, 12 May 2021 09:21:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydr9waYP7Jpamtm9bzEaLSOsy1a0AzqGhqbEnEBsYf9T0POlrqLsbsKHeoFSQLPYg4gxQv X-Received: by 2002:a05:6402:b2c:: with SMTP id bo12mr44669785edb.196.1620836465241; 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=fAbvIL0ieoTN+2FU63TXcWiv5nVfMIDFq2P0NGWniayg8oGU8fZOWD7NJdd7c+6FLK SuuRFvq3bFTP/ayGCScnl83yRtpSQ+P71BWimIFNR/jCb6lPAcOOf5LH0btVJdEWHdXh 8hCGEO8/7RoOSjIzFRmT4ZWO+C4N9UaHFCDDjJzxj8XXiQkhzfsu/PN9l80kRztmtNKn Cc3XQYa9pqq7MhLmoB1GnWsnHrGmqE9lLLQoh/fZ7+XKu+BtXJ2/9J4OEye7PMKJR0k2 W3orToBboh/vtd7ER+pK8AJv7XRP4IXIb3v3nXYo6/63vT7u0NlDAukEE+4MNQxkGJiM 5+sQ== 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=fHBgQ/qxpge4CsgNoiN8imv6lkvLE6/h99NmAUaJVkU=; b=Kpob2/Wto4V6oK0V05hDgzU+DX1gDVu2NFCv5TeQDCxrUHNd0QeQMk1UKlv9dskSDU Rn5dIeiIcMmV/y0abPRxoeYUbw6uct9NrHdNRsfaYbiCBp48JNOTL0dGBMHci243xRbC IOXKBS+YXJmsL1u9NPtKvJXslo68lQrvP11DuJi4epd7nMHkGjU04shdvTt6SaqIevWx 9SCVj/9nGmWvAUQvp40YuDiGm+DO3nHNLHOuFGPvkz7mkprmtKRTjLnfEqvstMJeylDv mn4QIQFmlvYxoLk+Yg+xHqVa7XNwwcINmNm7eiLZIYLC/z6HoZohJzS1G9MbiBaLVUw7 9g1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JNsw2JJu; 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 n24si368341eja.255.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=JNsw2JJu; 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 S240384AbhELQR5 (ORCPT + 99 others); Wed, 12 May 2021 12:17:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:48522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234978AbhELPfC (ORCPT ); Wed, 12 May 2021 11:35:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 87C576198B; Wed, 12 May 2021 15:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832654; bh=Ne5oA7d1Uhqff9qRZmUNN7hPZ4CMU6mywHgVFg+3m1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JNsw2JJuaM19Jiq22+9E/wxm+ghKi+AShWSc5fd7QAC+DJPX0iVqcAKauiNMhDGps 4lnDo2h1mPR/z5vWYTmoqYx5viO5gCY18PGdWPK4wtkZbk3bAVoPacH5TQFfUYuOeV y0L4wzwBzo4K/uvoX6yeoDfiF4vhebyRW/Lobgwc= 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 333/530] scsi: sun3x_esp: Add IRQ check Date: Wed, 12 May 2021 16:47:23 +0200 Message-Id: <20210512144830.751260219@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 14b321380eb333c82853d7d612d0995f05f88fdc ] 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/363eb4c8-a3bf-4dc9-2a9e-90f349030a15@omprussia.ru Fixes: 0bb67f181834 ("[SCSI] sun3x_esp: convert to esp_scsi") Signed-off-by: Sergey Shtylyov Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/sun3x_esp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c index 7de82f2c9757..d3489ac7ab28 100644 --- a/drivers/scsi/sun3x_esp.c +++ b/drivers/scsi/sun3x_esp.c @@ -206,7 +206,9 @@ static int esp_sun3x_probe(struct platform_device *dev) if (!esp->command_block) goto fail_unmap_regs_dma; - 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, "SUN3X ESP", esp); if (err < 0) -- 2.30.2