Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp450340pxj; Thu, 20 May 2021 13:13:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAOraCPm9wgk0uBvGhq65XXj3bzjGsqB/xiiFU09lSQM4VyYzu1pzBDWiRpOsaJH1hdp+T X-Received: by 2002:a6b:3b92:: with SMTP id i140mr7082444ioa.23.1621541623147; Thu, 20 May 2021 13:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621541623; cv=none; d=google.com; s=arc-20160816; b=j7pMl4shi7bl9k/kFo0HsyEFDpNwISm0biQceNgg07k/Be+e+D/YVx58GlaQ6+49X3 Nbrlj4u1j1ixQQbdE7NwLI2va1RJ8QKTLL6tMxMCXJesOhNh3tv2vJ+k0d+EeaFlcjRv s46OrcA8ycCP7qtohRQLQXCin/9eq/ugu/YtN0GH/tegDu20rUiLlUzUSS0I8YXaCdx2 wLH0JSCSnFaivn6hhHJ0BRBnYb63+3Ch5XsPek8oUFrETWOw0gZ2Oi7qER3rRVpNl7Nc Bx22orIkXwcgxi6wV4VHGIfU0YeJrevro/nR24ujF7kq44a0yy/JLf8RuUq0eaa6z73d EwpA== 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=iuAIerjh+5IWQO9cUsad2SqqqJaqNONgyTKXHhLIFsE=; b=V7yhOjJeJW0gIqYHDPvI4IiZVTLYkWCLvXI4KjeXETO4YpTmEqlYLcOskeZnB74bXV IewU6k5E3OZ7knkp3DPz9eD0maI1Q2Pl81E7Uo3r4aueDqWIFJ7UGLuBs5D9dQEe8FM+ f4phI91wNkEosLdUGZ29qqu+HZAOnSOGAO+aXOXIB1j1uY/ntveTLFneGYpV+T9MQ48B hsQzaF+kQSeCnMNyqb4sn5Ib6jsCsGI+yriKo7zLaXfby+4x6nasmpi4PqzLJit11G8i CGeARaDScB5DiCzzAdNytee1lgR1p068Ncm7KrgZn+u56biD/4YXTltRk96IHmTasD/2 06pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tINhdjIv; 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 g6si3363581ila.98.2021.05.20.13.13.28; Thu, 20 May 2021 13:13:42 -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=tINhdjIv; 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 S238162AbhETKql (ORCPT + 99 others); Thu, 20 May 2021 06:46:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:58796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236806AbhETKbN (ORCPT ); Thu, 20 May 2021 06:31:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3DBF4613FE; Thu, 20 May 2021 09:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504316; bh=FJx9plFRkCLtY+h32Yo0G9TZRxeVfAmOVNZCVF8I4iE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tINhdjIvC+eVX5QlN78cKBjI93NxCSYW3Tv4PZyrDZrE4wrxyre5NgozPEXoF4+43 nVp70MNdhPk4uIx6AY2ALNNTLbh98fPrr0Ib/lBifu6u/8a+CtgEiPXMIJZexK0hhc 1kqI8Gl/wP8TmtLRozSy0wnQWeae+RuNs9KYjjsA= 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 190/323] scsi: sun3x_esp: Add IRQ check Date: Thu, 20 May 2021 11:21:22 +0200 Message-Id: <20210520092126.633465190@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 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 d50c5ed8f428..167ae2d29e47 100644 --- a/drivers/scsi/sun3x_esp.c +++ b/drivers/scsi/sun3x_esp.c @@ -233,7 +233,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