Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp416981pxj; Thu, 20 May 2021 12:19:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwjX3OET8lA8sN/Kx/+gX6Lmix5rXNAK3KBrC1wuKHE5X5qSttWX4McO752c9P75S61d8a X-Received: by 2002:a17:906:b048:: with SMTP id bj8mr6255124ejb.236.1621538368077; Thu, 20 May 2021 12:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621538368; cv=none; d=google.com; s=arc-20160816; b=jXnyRkBaL7zKZCNjLpa87buxXEk66riO/sBQtl0gIbOxTnsVMPYK5pUv56aXPzxW0F IWb3VpJ4Q6p4zipaGxsopONGYRTWZ6QMNHF6mXw0dNBj/sog+3QYEHrFViAD6WZiE0XY sH8QrFhP0QDJkCA56nsv3wvLykKlRTCRzyyB7c8lm2frMG03Pl4Z5fnW0j9+vo42BGbT SuSs/RSFh1koP9CJdT2IsQPrSsLeRF1UxxizuwO/zc28j/C/qQz/MRdXrNdz4FD7xUb1 iFV7vwnJ5el/gf4Arg6sf/UrENehBrpIusshaxT1E1K5PW9vx060rxTwNkbFuqL7tLSg LzeA== 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=MnRiv6an2Auza7JOH2qsjBY8qQAh5xvVPfQqJHgV+3k=; b=mvmEPoPO/i8E4msIUBrRUFGKajYVdxJIU+TWLQdtDF6/s3w5w7EVUlLmvyZt0pGjZP 1GIUK/qJHWCucrAp1t772WALh64qo8Gg5YcI+Z7saCCMjdlxIT8rDvKpXJZI4CJD7JKM FeXljs0IeZ7PERlQO/JLd7A4slTlbg1/GuvAX5cWU/Ox9VunQhaPt/ak/TQZNiid7erA x0P0DSykJm6S80raw98kiodKFP4IcHyQnhlXhfO9FXIrxU1ZHAVQ7sGUEXQoZuOsJJyz EWv6lAsIxSkoauFgh5tol3RbKUuER5PpeendsxMZMiZT8aRmuww89WYCm+l3zoaNH/Kg z0cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dtkwDMRA; 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 o6si863587edi.18.2021.05.20.12.19.04; Thu, 20 May 2021 12:19:28 -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=dtkwDMRA; 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 S238144AbhETKqk (ORCPT + 99 others); Thu, 20 May 2021 06:46:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:33738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236651AbhETKa5 (ORCPT ); Thu, 20 May 2021 06:30:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D29761C38; Thu, 20 May 2021 09:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504314; bh=3Gn753fkwrHl9WOyOxVbJ+VolEhzTSTT82586210nyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtkwDMRAqM01wDYwxe9jmiW6Kt63o4lNXbHmBVtozwwB9dEQHSKnR03eul6eCJbpt Jlzxuf4lNbHj4SFqQKZQKqiKWyQKDiKSDb9tCfrdIHEsHi9F3cRLFi567uBKm87fFJ RiTUsTmorVblkiGzAad5CAuySkdRG6pwotcajAfQ= 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 4.14 189/323] scsi: jazz_esp: Add IRQ check Date: Thu, 20 May 2021 11:21:21 +0200 Message-Id: <20210520092126.603439354@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 9aaa74e349cc..65f0dbfc3a45 100644 --- a/drivers/scsi/jazz_esp.c +++ b/drivers/scsi/jazz_esp.c @@ -170,7 +170,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