Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp64485pxj; Thu, 20 May 2021 04:40:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt3DASsQb3DHgOLa/xDXGCaXLbD8ojz0OirriZ/dJGLRdY8hWgJDz0VVzsjUWsIXnmYQNk X-Received: by 2002:a17:906:3a82:: with SMTP id y2mr3265544ejd.145.1621510838377; Thu, 20 May 2021 04:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510838; cv=none; d=google.com; s=arc-20160816; b=qMTIQSEXU0f5QDQvrGC/Q01i2FZkCKEpRO1nhWi8kltYWwsHzo2MpWSfcaguAtgTLi KNO4rMREO6VnFW+AKCJg0hTdsQ0lHDrf37A7qa/JKCsIcD82IVvAcM5WqDh654tcIUYs pfrXgaF0L8HNi1+KuPspobJuibwxnQYlpPXh9hUN3/3UWnaKr2dwJVkIWTLhy29gi5ab 1qm/197mY22yc0jMKL/3C7QC3lrdCg4npaSS5vnq/nn01vCGCLDCRhEeHm2khUFsITiG 6T4MdSqP3zupzsz5TYfhJyEbUsFHU0Kj1RvoiaTa4+4uekQJ9UrHYhEtYprAPao+Pr+H Ql4Q== 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=RKOHvnzCaC93au/vxsFuPhQXQan47PyBvcm3HruISYPO4zTnJvpwid9G5ZUi1sg/0E jogOC3DQRk7DTcu1P4YH9mHpjX3Bjpla9qHm1T1CmMQi/sQdkQhmR22CsfA8QlZyRVHi QCC/in6NUTV5jxDabf5bkSqN8TXDcvk9kySok/xyhyzZj/iGwobDmczFkDoavZWQeYQ6 Tej0ihrYcDX2+aP/hS4y7Z5+84bMHTqyRCB+QEV5R62MyLGFvkrWN0P9N81db+q6CiMm FR6oQYfgAY6OuKGD8yYtWnaSEDwUDHuoxfYJpZog8jMC40A2AYdgQbJjYspHRUOGdsBw H3Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RJX4sShV; 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 s25si2348958eju.101.2021.05.20.04.40.15; Thu, 20 May 2021 04:40:38 -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=RJX4sShV; 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 S241979AbhETLh2 (ORCPT + 99 others); Thu, 20 May 2021 07:37:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:37932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240212AbhETLRI (ORCPT ); Thu, 20 May 2021 07:17:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F3BC61444; Thu, 20 May 2021 10:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505377; bh=3Gn753fkwrHl9WOyOxVbJ+VolEhzTSTT82586210nyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJX4sShVJyvrdgmEnCHyQ/PM73rkdS5ahe3vElgsif4Y/QuCnyO1DdrgvQUiY0Kfn hpQurrCbKsoBqPvaCma7PB3KXPo49HIPwaKr1lMcnAq1o/SCsWEm6wRIdd6Q3U9tQ/ P6SMl+ziiOCiKZbyaHxSTvqLAQ5QlzbGgM9dqlqs= 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.4 106/190] scsi: jazz_esp: Add IRQ check Date: Thu, 20 May 2021 11:22:50 +0200 Message-Id: <20210520092105.701621938@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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