Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp546495pxj; Thu, 20 May 2021 15:53:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh/psBpeQtiwh5xBSHMOSlG4zEAD7dLHIOrecSjfMsg7ibGNSOunNgAg6ROSd3Zuu5IVGR X-Received: by 2002:a17:906:1311:: with SMTP id w17mr7249431ejb.182.1621551237190; Thu, 20 May 2021 15:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621551237; cv=none; d=google.com; s=arc-20160816; b=k42UGFLu4oU8jQi3J2CtSDV9QTi7U6oj6O7apBkySYIAdFtVPr4HWIG7swvI/v74i0 gSZaH6vorXXpRcfauJkhXZGEZ2XihuoPpOUtmBoJYkUyqwMJkyhkwyw1M2DTBHqD6u5V f9is3SzSyUL1pz8vSCp8HXDadwB804hSPLUxOtVVASFMAuRLlJuziE8GdORdlDGlFcLy FoJaPhbFpl+XU6dYRwaagHH7fVn6d6A2n+ZwDsHwG2kMHiRES3WG82ZZpQlZrrcUMenG wjztvWqKm06O3K6ZizBmjxIOuPlRHUdtzAH83HCXW5YZ+TcOLmVXZ0Fp1pe1aLhUF66R knew== 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=OgOgGWyksWl97y3u9AUaqqXyYvOaush1kBpfa2ivpKZ6FGjvXJdw1dtucCnr2tGbRu AM+envVJWRhqMcsT4/8KYVvg671UPFeHaGfRcsn2xDhxsRdDQ4XigF84r3Bm5NTGxnNH I4bINXbtMJylexWLH043XJp3HEPqfogJpHRgKTmNAU4XT9KgJ2ZiM7nXx3lHIUCi12o+ EJJGeEOqzUGEAVCvF0daOXPjTeop+1ZFG7r8wCf9AFhbTbwpSOP2X0L5wUXSbinCyzHN G2AxnTEOVCdRhtK2nVwvUHGXcphRyb6kPCHSi5CWvc/WhD3wafxS7K7TVgxqrzzDkksv prAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SZA8dWGT; 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 a65si3490765edf.266.2021.05.20.15.53.33; Thu, 20 May 2021 15:53:57 -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=SZA8dWGT; 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 S239392AbhETLQr (ORCPT + 99 others); Thu, 20 May 2021 07:16:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:52608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237399AbhETK4W (ORCPT ); Thu, 20 May 2021 06:56:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 891B561CEB; Thu, 20 May 2021 10:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504904; bh=FJx9plFRkCLtY+h32Yo0G9TZRxeVfAmOVNZCVF8I4iE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SZA8dWGT7oKVpO5wcB9bwriJVfL4xjz9uRji494DZOSiNcbI5Nl5A4wUEFLGwsP0d uNbXOKJak9LmeYCuJuxyMaKkKAkoVAvrsVauicscwdMG8eisJhZ71+DPS8Q4I0lc6q FBCnZTVpvuShTIO8GNA4YjNkrNS1xlOosRc8HglI= 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 133/240] scsi: sun3x_esp: Add IRQ check Date: Thu, 20 May 2021 11:22:05 +0200 Message-Id: <20210520092113.124822785@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 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