Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1861750pxb; Mon, 13 Sep 2021 07:07:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS8/LRFwes/gnqlFsaaLeFKLxaBR38xBD80uVbJRpjDthOBSmnlXiYgFCXb/QcbWO+bXOK X-Received: by 2002:a05:6e02:dce:: with SMTP id l14mr2467180ilj.272.1631542076268; Mon, 13 Sep 2021 07:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631542076; cv=none; d=google.com; s=arc-20160816; b=AwmTdHkeok0sTAqbcbJksfhNVtA2OZGBPf6dYB3onSWfXOKgeaX7HgrJ2BKm9BNdjC N1wDc1DNmvbaiJD77CyKuSPtEyOgSNMaSAU0eVnWqLOnsTZDa+UuHm7wG8ABH07O+jsM yXKlxY1PNsCuzy9yfDaAJ8tyvqNsh+D2iORwYd9TKZk+Z2bsrF+mqU6K//paDgvN3Lve cqQgfFmieQOsLfjBonFG3pPp3GmcZ6Fa38d6O4ZfLcELA9Ewy4hQ2h9Bf1lkUaPNaJLX 1bY+WCsa+qCJ6YasMXVao4IQqN4wyo4Pp90upfP+fRcYl9Gic7k3wgho/kN9kxy/WJo/ SKHg== 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=fLRsiy/rM8svjsMSvm39KE8QoU4uBpV7oeH244Q0mr6yICcaebwmIidtVtf26frPih WLbxCS3yP0xj+LBGGMk3HQYCnOwkHS3E5Fnsh9YHvztHhL4xhPVfOnkr9iDncXfxtOwc RbwarsJevVX0IRUPRMeUUN/ab176ZhvgiLJSHeVmbJmV9ImmHgZct37VlWIUh0LrDfHd TgXp/nvbFeqO3kgiXkZ4ddJOEMgaFTCRM5qund603XcyrLgvnhTYOtbYqRzbQIeZbVFq iKJy1tTStWYePalYJZOVIKY/Vhq32nu3X2+V46lAmOLamK6oMIRzHvR0jS6G0OZMGqA+ ighg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gI0qx9jZ; 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 h5si1487903jar.102.2021.09.13.07.07.39; Mon, 13 Sep 2021 07:07:56 -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=gI0qx9jZ; 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 S245267AbhIMOGG (ORCPT + 99 others); Mon, 13 Sep 2021 10:06:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244570AbhIMOCq (ORCPT ); Mon, 13 Sep 2021 10:02:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4B4D61A3B; Mon, 13 Sep 2021 13:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540306; bh=4AeE5WfbLORWsAT3jU2iIbCpPd29hPNC6tCN5hoShQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gI0qx9jZPA8sR4Ij+3+byHiwqtEIAfvJ0lMBT4BVsTN/olAii6gO2/IRR+vXdXV3+ 0MvaXXER/+MQTOMzBNCytvEEufWGh9/cXDBJOc7La/SqUBplg2tVRiS6PZ/iJu1PqG SRwTnBh3kqHU1wk2cwJTkhpmVicyOsstr8hTWO64= 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.13 139/300] i2c: highlander: add IRQ check Date: Mon, 13 Sep 2021 15:13:20 +0200 Message-Id: <20210913131114.098284331@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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