Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1840959pxb; Mon, 13 Sep 2021 06:43:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD5PE6SXlZlYnGYupe8RMZY0Ku7zx7vXRlwnxYw0PXpTDg7F8NBLsA0u2AEIJ3KnY78OOb X-Received: by 2002:a92:d90b:: with SMTP id s11mr5440347iln.206.1631540603150; Mon, 13 Sep 2021 06:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540603; cv=none; d=google.com; s=arc-20160816; b=PvQzVO1nyLkmeduBG0l7J+DEhxGq6FGVqTkuuPp+7TimdELHhG0sJVlccsDT24CGiN sKWtP6/boArpQ37kG7SZh1s3AqotPoj0HTKVBiw+A48ea0XfZbiKKgqOHW4EE7ezwt9g l+yipexNDdJOdrjY4Iol5MjNlIvDO2GJ6Q5jFCLNOsAgKB+FNsct5MawLolpd18P0NfA FX+hZUNxiLqRIQDWeu3oyBQwOGMoOxfWSVplDHX8LxBFPPnEIgm++CY9qvA5IkFD0XiQ v9fe7QTbTAXGt3CnLPymVTliy6jrOgkwVdtMLr20V3jW8ZdLyo68awAfTApcXZe++0YC qEfw== 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=GtTQruT0vw6XONk5WkTLPHywo0BCkV2Ihl5P8gkg3Kk=; b=BMrRm1OWcKOxbwqJPJrU/663XrhZou3mjJxyPBSYYIryIMAw94OcnhiL0I5eTFG4Bd KXms4F4QJ2DfrQeWhGPAa8pXSYySVNIGhROwSoekcvSvEG4RpDI7llWPuJNpatL9azG1 Q7e0/aP0PWjM3G5iWGwup/Jrpf1IRnSzjTI881UefDqtm3z6fZF30YuIQNJsp2OqYT7M P6A2pLho0qbzCpT4d0IXNeY1abZJSWU1rlFHpE90veV5Ap4YtZgImhPy2K97l5G+ilYn S/xSfcqXUfev8k2DdQllVkiqdAQrZjVREA+1rD3hFAZ3CFTobiD/YKLiGoqVTpWbgsuI RH2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J4FStc51; 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 i6si7054844ilq.174.2021.09.13.06.43.05; Mon, 13 Sep 2021 06:43:23 -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=J4FStc51; 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 S241358AbhIMNnA (ORCPT + 99 others); Mon, 13 Sep 2021 09:43:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:34856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242706AbhIMNhM (ORCPT ); Mon, 13 Sep 2021 09:37:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F780613CD; Mon, 13 Sep 2021 13:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539686; bh=4AeE5WfbLORWsAT3jU2iIbCpPd29hPNC6tCN5hoShQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J4FStc51ayZ1nATlrCNauEBLcfT0nrSw0wXAiOaV9lEjOY9t7YtY1LliOWcKt4tg6 yDZTK959JXZiRe0IfIf0WmMUUOFK1b+XnStnWEDFqHK7ZipNp4g47lvaWI2K5P3RcM LywIpiUQKgTcgSLqRsb6XrYJ5Yi2ordE8Xbx8IoY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Shtylyov , Wolfram Sang , Sasha Levin Subject: [PATCH 5.10 120/236] i2c: highlander: add IRQ check Date: Mon, 13 Sep 2021 15:13:45 +0200 Message-Id: <20210913131104.437679942@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 f16a3bb69aa6baabf8f0aca982c8cf21e2a4f6bc ] The driver is written as if platform_get_irq() returns 0 on errors (while actually it returns a negative error code), blithely passing these error codes to request_irq() (which takes *unsigned* IRQ #) -- which fails with -EINVAL. Add the necessary error check to the pre-existing *if* statement forcing the driver into the polling mode... Fixes: 4ad48e6ab18c ("i2c: Renesas Highlander FPGA SMBus support") Signed-off-by: Sergey Shtylyov Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-highlander.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c index 803dad70e2a7..a2add128d084 100644 --- a/drivers/i2c/busses/i2c-highlander.c +++ b/drivers/i2c/busses/i2c-highlander.c @@ -379,7 +379,7 @@ static int highlander_i2c_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dev); dev->irq = platform_get_irq(pdev, 0); - if (iic_force_poll) + if (dev->irq < 0 || iic_force_poll) dev->irq = 0; if (dev->irq) { -- 2.30.2