Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp342826pxj; Thu, 20 May 2021 10:33:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR2MGpc1CAjPQpMnBMvYKS8aCILWha7s3nuftDVN5WTqdnOB2rH0H1iR6SJ//pebJLYlI7 X-Received: by 2002:a17:906:32c3:: with SMTP id k3mr5642692ejk.95.1621532020769; Thu, 20 May 2021 10:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621532020; cv=none; d=google.com; s=arc-20160816; b=O4h5vCwt5Xk6s/XHHbTeYZBMOWqo7l6XL8byy5thzYToZcsPYo1WvwfEQd8vW7KvgB pep5Pd1XYtABydNp835sOn0BShSDUUjLZcesr2+9IooIUhThTl+6eD7L7ZhodMM3wsXN Jc4TYCQK/DYOkJKWC/1EN/o7g2j2HiarS6+GcSrCTAoHRVbXIg9eAyXgWcIDRHy7kq4g vn0nk1jkfZofkDkYAZLQu5E9tz0G0uWha3HOOujV1uxDy82qN7nmsoRh7/hL6ui+2kIf TdOaHQWJI8P4c1wSm/4HwNAcrsd7+K9l8hY6gflAOeADDzAONW4EEMeefS9mY2qbrWzJ 2JqA== 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=Fl3IeDkHyyKkzndTCbAkKO1JHpgow7J0GsnkBBeQjdA=; b=YQCve0//KVwEdT/OabekIW62VHcv7GtxInUo3n01TETq7nha5jZZuWGcuyeWSvKoE4 P/IuUb8mKk+tZd0BlO49rStgELoTD7Qt0T/j5PoI05jIobeVHsGzAwE2JFH71y+vVQeC hc0X4cY8o1FVL2Z9eXPDUag81SHYVv+Hj4mCemaz60c03EMopI+LwuQPw3pUFcE2/dHt jI8/KVmzVXoXLqypYLJygA737TxWdomT1j+u2Kg8lyvejlO9/S1efdza+t9W8qE5LBzc TWelhqRoVWDFubB+KNAqgWbJ5GBqISzAsigPySi8DEYnCdvutDkI0d8IACy/LfHYoHdb dfdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nkM+Veb6; 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 bl4si244401ejb.17.2021.05.20.10.33.17; Thu, 20 May 2021 10:33:40 -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=nkM+Veb6; 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 S235026AbhETKBt (ORCPT + 99 others); Thu, 20 May 2021 06:01:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:58884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234809AbhETJ5a (ORCPT ); Thu, 20 May 2021 05:57:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E05BA613C4; Thu, 20 May 2021 09:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503480; bh=5QCqTbrqK1neTRtFoEs1yh57+EA60LQKgHDuV2Fxf/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nkM+Veb6IzRYRM8niZTK9yyd1FIs27HB2jWRHrWuhtoKAzpgvOybnTVL00eJoDV5b NHayDo7iurI0x++XXu/MCr9Rrloeehj9G4SMrwATwhOc77B7FJF4iV38kR7RPywgJs /lOL3JT4hZqtanRsh59lRon9xISzy5MIn5NRn/08= 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.19 240/425] scsi: sun3x_esp: Add IRQ check Date: Thu, 20 May 2021 11:20:09 +0200 Message-Id: <20210520092139.314215834@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 0b1421cdf8a0..f9aa95e48eee 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