Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2318880pxb; Mon, 20 Sep 2021 18:41:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh1IoHBsPbC4yAa8jxBVEY8GeXYFIgfg+e07djl0ncbmwMj2oLQuYQazVB+PCaRXZeQRpp X-Received: by 2002:a5d:8b8d:: with SMTP id p13mr17043189iol.216.1632188488388; Mon, 20 Sep 2021 18:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188488; cv=none; d=google.com; s=arc-20160816; b=BzeaOlA4G2OWa0OqDHzntJPP0NQBAPf01tXXEzt9+STH2wQbHo621M0+1m6ysz0e3Y GcOpJHKP6aiPf6ZOsSKrESKXTX3riT1XzpxEqu0RLx0QE4w+HuUu4GKGJGCGy1MP3bcN PAW2SIgPQlfeiKptiIcv+88KImTfg9Bs2bJVCmu/Nl5RQ8SAQmpBvfAH+n0qTB4z9v3Y O+tQbMaf+B49J8RCYRGGRATwM92RfmLo9bb6HDbfWn/MTxv7hvlZWpLJvPSCKTr3ZMmc VmbMP1UUvC6Qi0cblqG49UmSDi2vSk8SY3Cq1g5rzfs4xkBkiG7+NrMmGYjdQ3ZpdAVN DP3g== 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=K3585Qg8rAvBlu9Ox3N6LV550sMrgq+tihH6q7s5QTE=; b=DmQhfFeQ1lb8ge1fQ6yeEBwqWXvLydFbXPWyy7GAriTWQabZ6TdqVklzYMCoSlag01 F8FHL/efCfjGttcL+5NOzXiR1PJ08svPOIARO678DxCnQ+mtnjrkgkXGB+wsnQEY+utF cRpNG2/4zf/6Nsa+SQgetLUuRv5bcbw/AfU9ZPV2s8/vz2qctafRnGRLg2dz2tf38Y5f XyvGYOUihqF9AjLXV5XGKLovNIEd/Oq+B1XeT0ZK4lE3VDIQHkDrEdmVy0Qk/evfn847 LDWnYwwR1ROYR38skyZE4JxILiC6T2yYopO/CDx9RUz13Nkdj8DrQjMgUAqKzEv6fakn ok0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XFTM8AK9; 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 m3si9091541ilh.180.2021.09.20.18.41.17; Mon, 20 Sep 2021 18:41:28 -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=XFTM8AK9; 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 S237796AbhITQtK (ORCPT + 99 others); Mon, 20 Sep 2021 12:49:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:36770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243186AbhITQsN (ORCPT ); Mon, 20 Sep 2021 12:48:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17DA061242; Mon, 20 Sep 2021 16:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156406; bh=uLsbej8As3Z7LC8izUaOy5/i10mwpAJ1+ug+RWl0KA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XFTM8AK9kYb3VxjBX6/14t70EN1JIf6ykCL0+eeXBWzgM7tR5y/K5vCfDN6+mqPiH o9OYAsyUJIIo+zfioqTlY+Pf7s4LD+FUf78KV7bk17PQXjwMWnQ50uDo0Ph+ETezAn ZRjUKPrams16SQ4+nJ7hZV1uKSg5FHLAyAbyKPo4= 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 4.4 044/133] i2c: highlander: add IRQ check Date: Mon, 20 Sep 2021 18:42:02 +0200 Message-Id: <20210920163914.092419244@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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 56dc69e7349f..9ad031ea3300 100644 --- a/drivers/i2c/busses/i2c-highlander.c +++ b/drivers/i2c/busses/i2c-highlander.c @@ -382,7 +382,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