Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp618934pxj; Thu, 20 May 2021 18:05:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwooy1JwfsZk8k50Nc2H5Xi070v3D+/mmvCgkSsk3s8DYbPcH6q6YnAY+diBnJYG7vCvnI2 X-Received: by 2002:aa7:d913:: with SMTP id a19mr7954526edr.173.1621559124636; Thu, 20 May 2021 18:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621559124; cv=none; d=google.com; s=arc-20160816; b=EoYCLdMJYRj7feTojq6m8MhtS5+ViGaZR/Z+CSCtmnpS0lNwOmDX9Xd+o3V/oQ2W/i tpAn3AlnZMDznYiWi3vltSkYVxqKNvjf2paJy4N/3IX/qcEsAWUp24DW2gwPW/BJXbs0 7MWzeooGNKVOrRE0SHWVAhpdN2Tb2nItln6GJTPEhiPDs8d9tQd78omzLf58XUrdw33E au0s0aJbx7qqEraZE2sMJr9beHmmjVQlflRlgSGaMAvVWMYIGQxaCCxDrhTdqxeG0fpl 03Yw+jWvYeYpGFJzWJ3O3BnpGomdRHfZBjd3kcVrYs+olSUe7fLpDxiRlu+IWxtHPKLh FBrA== 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=prY22ChrDe2iw42TRuak3gawAJisK7JasbJdOiFuIdXxIUHh9uY+p7xytuqO/NqS4W mPlq5mbYeopRYa3cBatIRhROPcJ2f8LS7dmNT77oozNY2uGPqj9gu0NdfDS6HJCsu8Xx CETBGRmM57rZmmB9YGrnDOgKKtSK63YjWmJe59vwSzvA6ayghe1PlUgthl2og/ZR0wym ZjDWW6t1j2el7y227RKgOM5cxpOmaD6a1+on1ryyTZ6jAvbTMCV6A63HOUCZQvUn1nyJ rxtUg18GzQbYF4ZJ0HSWPp/VnOLjBFhKg2W83iyRsRWa55NeZO2LpFAViqPNLGVI+sbd NXcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=u5M1ZOx4; 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 h16si3784179ede.572.2021.05.20.18.05.01; Thu, 20 May 2021 18:05:24 -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=u5M1ZOx4; 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 S241849AbhETLhR (ORCPT + 99 others); Thu, 20 May 2021 07:37:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:37934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240245AbhETLRI (ORCPT ); Thu, 20 May 2021 07:17:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 731106194F; Thu, 20 May 2021 10:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505379; bh=FJx9plFRkCLtY+h32Yo0G9TZRxeVfAmOVNZCVF8I4iE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u5M1ZOx4ox613CpzI4ZlQp8XYqq8LK63Upv8eIfacGBvgCRwH5fGmhaqMyG3HBd1D U8CuXGXGm/si5vA2hgp21BKzX+1S5BtdAWekxBI8iFddgoj/klgVL6m30FHKVGV5K7 ZFjRcENUmw5rX5YsJH3wo60YGpKE7yQ+DbcDxtFg= 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 107/190] scsi: sun3x_esp: Add IRQ check Date: Thu, 20 May 2021 11:22:51 +0200 Message-Id: <20210520092105.731961553@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 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