Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp546436pxj; Thu, 20 May 2021 15:53:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEqYVXr04D2RcD1O5EhKbjSOt05+ToLCajo8kjj9p5SdPENUbvJ1HH1gjC2WrfxP/pFtAa X-Received: by 2002:aa7:d9d6:: with SMTP id v22mr7266334eds.16.1621551230616; Thu, 20 May 2021 15:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621551230; cv=none; d=google.com; s=arc-20160816; b=Hv8qG59EjOXpuDYsxvZLPCZNOMRCw4QB2Jm5qMZGv2P1gZ+ewaI1LgmNF68beXiAci WThMRTUdLquNKXuJm3Cj2llmSK7EMVKmMi3MCfIyckDS5gLOa5wRW4ecMTx/6eVx6xkF +7U6QL5fhGk76iqqx2CR2p+49IJUFfUYzXoZlxzyjj9o4GW7edJT7PHDpFu8InraYwMt Opg3rS72TjibFyBriCB/Iplurv20438X/1TyTxf5tH6mahbVeGh/eN93IWPdILkcUX/f 8Y/3BOEFvTUIb3wGS/j4i4I0c1zGzXQ3a0PT6TWTQ6CmA5pnJlhl+Gr4yrDiVE202mW5 2mfw== 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=MoCqqqaE2GYElmxfRM4S/k2Fos1NQVjBtZfw8b5aH/eXbKLwwgVgpwPzB0C1uLluNx 3NHxarkg46PrKl9cVJFggaIiGlKuDCaED1/iBblxuZ2+DKxKYM0XDkLQzqOSoEtJLFlo I3KxEJoGGmQO5qRrfPn9s9r9/HSHl05Rwk30fIHgxZ+rUgUGa5EjNqtUWOBXksm3ctHV zq8lI+O+RXC0KaqZ2j627td9OrEjVQxPOgE8UJn4YAiOHOlAHwsacoJOYyWLkMDIuE0a 25RrtelrkBBeVMGIJCTUYCDKHPd9y0PShZEu3rV0EcIykQI8rKTGTO1KHydmCLAi2IsT GSWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zhzkJLrD; 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 k3si3547413edi.75.2021.05.20.15.53.27; Thu, 20 May 2021 15:53:50 -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=zhzkJLrD; 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 S239799AbhETLRB (ORCPT + 99 others); Thu, 20 May 2021 07:17:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:52614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbhETK4V (ORCPT ); Thu, 20 May 2021 06:56:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 583FE61CE9; Thu, 20 May 2021 10:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504901; bh=3Gn753fkwrHl9WOyOxVbJ+VolEhzTSTT82586210nyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zhzkJLrDtdtWI5pTf0FEsJU8gbM3Uxo+2Y8IaACtL8rB8RaaBB2dxi0LF2Q+dD9/e rYKReXGoe7CWnSNorMlIiVv83GBVsksG5jSIHLmsOG8Am3a97SJPSLWQJ/DMz9cR+Q E4RbSd6r9z+snSqKs7/B3JHTb61rtgjlAvgHn/qw= 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.9 132/240] scsi: jazz_esp: Add IRQ check Date: Thu, 20 May 2021 11:22:04 +0200 Message-Id: <20210520092113.093762267@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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