From patchwork Mon Oct 5 15:26:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290638 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3754EC4363D for ; Mon, 5 Oct 2020 15:33:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB4C920E65 for ; Mon, 5 Oct 2020 15:33:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601912026; bh=2SZ4vk7oql5z2JTtf35v3BNzZoNWaj5yxxKXDNLXKng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GZOJdzh/Ds+cSQ4RZMt/ToMcOac4RBqdtOIu0ESCntnv/88HIEGI5u6B/nRdqFb0p w92ZvNfpMG7mHtu+JgnN4pAA5GhPZ6PLXW9+xixolcbVzrKIKtZVWBzhPCZ8zkMKCE ZTlIsogYf4NS53uyfVCQe3E3Yk1my+36i94rCWjk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbgJEPd2 (ORCPT ); Mon, 5 Oct 2020 11:33:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:33202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728142AbgJEPdV (ORCPT ); Mon, 5 Oct 2020 11:33:21 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCEA32085B; Mon, 5 Oct 2020 15:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601912001; bh=2SZ4vk7oql5z2JTtf35v3BNzZoNWaj5yxxKXDNLXKng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Myc2H59C5Cxhf5ZHEJ8C6d68dy+rPG7fvIaYozwfKw5jatwsSYWH6McbWFAXD5kv5 kqPg62eUtIyc7Pfi8tHYqGGrd8Zbzc/UehcIivKGRZeEGHSOSovjWz2C32DZHHp1OO OThKW8vlopFG8rptKx4xB9AbGascr4V0TL0h3qek= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ye Li , Andy Shevchenko , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.8 62/85] gpio: pca953x: Fix uninitialized pending variable Date: Mon, 5 Oct 2020 17:26:58 +0200 Message-Id: <20201005142117.711433312@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201005142114.732094228@linuxfoundation.org> References: <20201005142114.732094228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ye Li [ Upstream commit e43c26e12dd49a41cf5a4cd5c5b59a1eb98ed11e ] When pca953x_irq_pending returns false, the pending parameter won't be set. But pca953x_irq_handler continues using this uninitialized variable as pending irqs and will cause problem. Fix the issue by initializing pending to 0. Fixes: 064c73afe738 ("gpio: pca953x: Synchronize interrupt handler properly") Signed-off-by: Ye Li Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-pca953x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index a3b9bdedbe443..cc95f1630feb0 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -813,7 +813,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid) { struct pca953x_chip *chip = devid; struct gpio_chip *gc = &chip->gpio_chip; - DECLARE_BITMAP(pending, MAX_LINE); + DECLARE_BITMAP(pending, MAX_LINE) = {}; int level; bool ret;