Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8103011imu; Tue, 4 Dec 2018 03:03:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/XfgyPXKi1nLuJNzDECLxM3OcUB/CmMYX5aa/re5dQlAnw0rdmfU31hIrP0rwyTTpIgRs75 X-Received: by 2002:a63:af18:: with SMTP id w24mr16510991pge.385.1543921425826; Tue, 04 Dec 2018 03:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543921425; cv=none; d=google.com; s=arc-20160816; b=vI4sy/ds8j7n1pvYVpzQBGXdC+Ng3vR7giAr9kV0KuCG8VFqZc8mIb28mzvMVBaIBB FZeoPLghKlsAQDCMWo52Fh8EcXWmcEhvmMF6JACNMW70BWZpNkIKEfRtE37QTZACEIew vCu/ObKjm1+gsmT75SHQYDkgGJnwrfMpXx6tkmd0SOZilGTd9gXP9v1JxMplIW6CXhnm +ZiTSk9aK7ckeZ/Chtnif7q3fOuemfxLlt99heWaCmwlEJnQHTQNY+TnjDiRoOVuvPt8 TDhE8Jf5iU4FmgXaP35efMgWddvGxgLje01aNUo0VGsJREuQ8yfzFSt3JI5dgpRK4fDu jdDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ocnKg/KK4hU1E/QoNwycI0JBT9mc0FpeZ1p21BYcTs4=; b=LIFegA55A5qPYdoWSnhSkcdcfij/cTu/fPO3T3acyR6GOts0H170vB20xhYzg4KnmV +8XP6RR6Zsk9uGKrFbhgCWG/3tIGX2dSkYG28JAgTPOyf0s8qUQV+A2Fucpr/QOKHref dJm4xbl5uhNtHsw5u6/5cKiM9666D1IAPJoNt66k1x/QWmzVGCV7gVUZs88hwXtZPUFN duNyJrkclFfEsewcvMCm52jYs2mJ1Vmu/TLCXHntMXUcawMyNY4xcIvtkqfKt4Fi2Snv IhaieENjAFS9J0QJzWZM1CjTfstQn7zs1hB7Ba3/pIuc/CS2gQo464g7FyP/La6/ZghM Fl2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UZkYlLHv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si14855627pgi.260.2018.12.04.03.03.29; Tue, 04 Dec 2018 03:03:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UZkYlLHv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726888AbeLDLAY (ORCPT + 99 others); Tue, 4 Dec 2018 06:00:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:45574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727291AbeLDLAS (ORCPT ); Tue, 4 Dec 2018 06:00:18 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 A66402087F; Tue, 4 Dec 2018 11:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921218; bh=eUz4JVIwxuElcrRMF8v3SBYGj8g2TiHASa2KDgDGilE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UZkYlLHvdiZ7Y53KTC7jvg26pjVyDDnGA3qRxsn70BrrT6909s0Iswu4fg2zDkwSL s5qDzIubZdK8zHSV9LFVuTxF2Ch3uG8XvNFyI6npjJbt7TkfgpnNtpBTTz8a74JAWR /2u8CRXGos+dbA3PkEhTXJlInjdRDiblogv+MOp4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Sergio Paracuellos Subject: [PATCH 4.19 127/139] staging: mt7621-pinctrl: fix uninitialized variable ngroups Date: Tue, 4 Dec 2018 11:50:08 +0100 Message-Id: <20181204103655.955006571@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Colin Ian King commit cd56a5141331abfe218d744a3d66e1788135d482 upstream. Currently the for_each_node_with_property loop us incrementing variable ngroups however it was not initialized and hence will contain garbage. Fix this by initializing ngroups to zero. Detected with static analysis with cppcheck: drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c:89]: (error) Uninitialized variable: ngroups Fixes: e12a1a6e087b ("staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function") Signed-off-by: Colin Ian King Reviewed-by: Sergio Paracuellos Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -82,7 +82,7 @@ static int rt2880_pinctrl_dt_node_to_map struct property *prop; const char *function_name, *group_name; int ret; - int ngroups; + int ngroups = 0; unsigned int reserved_maps = 0; for_each_node_with_property(np_config, "group")