Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1824724pxb; Mon, 13 Sep 2021 06:23:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuU3P4cr7qibOpcxkw/IuvJ1aufcSwlX6NQJpOjeTaRae68wglbWQ01wrEPO/nmGc88VAW X-Received: by 2002:adf:9f4b:: with SMTP id f11mr12727611wrg.337.1631539428037; Mon, 13 Sep 2021 06:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539428; cv=none; d=google.com; s=arc-20160816; b=x0JRi6FIf6u0pj8YBWa6l/oL2NcfNMnpZj+76U6wZb1aU9m6PuAWAZljhv6gyITX5N EcScazB4llGZkMqFl06uhWPOoXVDkBaenro9tHa6cesMVLJRMxJUiKtg5hF4FAw2NbMI f/i9MPCdqKpNR2HucO0DkPo1mtiuoGh/rx53P5QfDtvIlpHuhqgTnmyzRzOk2eX8/NmH QN7eoiDaaEiqp3lAspN3m0eKH9OaLj5PTZqqX4YR3xouSZgBsoA0Emdf6C821Vz6ci+q YKfE0t9K/6itQ58jmv30urk99AnANoL6VpwTG1f7KTrMaV5enPxeCxWGF7DH4TEgcbXI By+A== 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=oFQG1Fvhfq7loIMBgAunFEHaE3JSYrghAPQho3qZzs4=; b=RfJKBY6juR2BqpRzktTGsUWK7ITfx7dDU69hHBa+K/ZSdh0nCSOy53MGMs33mpKXWX wnsShd1kFtcCZLiNbzUN7ECo3KgiDKg3YP10pw+Vxa7yJAdy21964S2mWAtpO4axRePZ ZNjZLDsUxfFdjSzB+NpOh9mAPAtpGFZL+ZMVaImOOTVCAYckyq22er80KyohV9H2Ye7X NuLdm0EFUNlhx2RB5wTGUYFloEbH+NDz6Ipe4C9in86JbmmNuTNoQaR1B/wC2+IVDfoy 4Cbz2ClSMz/u3g76KUefxHYon9iQYUAq9RHKy7gs3jyWz2Jl1JGTCDw1msZdJyYCGxud aF/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a7nECYI0; 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 p6si7667497edy.476.2021.09.13.06.23.23; Mon, 13 Sep 2021 06:23:48 -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=a7nECYI0; 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 S240421AbhIMNW2 (ORCPT + 99 others); Mon, 13 Sep 2021 09:22:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:35302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240577AbhIMNVC (ORCPT ); Mon, 13 Sep 2021 09:21:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ACC7860724; Mon, 13 Sep 2021 13:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539181; bh=bVY+hQhJCNipJnM5nmraGGdtxsMn/xqSgATVjH+WMF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a7nECYI0bxKt7iRGeOFLkSYxSfUnUrIGS2+B0gGOfarIvbVAFJdzuuUrqE+qHzZ3G yjZ6WB00zNGwTIACRoh3OtegLggdzIJTFt0v+96IZY8ffssvnZVVG6uLBT9XD7+80F R75wIunjCfnepBNaZn0sTy3Dq1qne4kZrq+odz+w= 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.4 072/144] i2c: highlander: add IRQ check Date: Mon, 13 Sep 2021 15:14:13 +0200 Message-Id: <20210913131050.371657997@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 ff340d7ae2e5..6a880c262380 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