From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SN4hC+FN" Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37760B0 for ; Wed, 29 Nov 2023 08:53:07 -0800 (PST) Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-59b5484fbe6so69677027b3.1 for ; Wed, 29 Nov 2023 08:53:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701276786; x=1701881586; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FPGbfDWwX47hn9c1TMZWvz82zmR4+7EsCG8Vv2EabG0=; b=SN4hC+FNTDurfIyFfIsHAfkfZ5mqCfFrrK7epLVqG2cuH+DzfdmN2xJIzzqPKbG2pF feq00LXuGCjMHsqd2S7Vz+0mZ7FI0pzllRkFRR3eoIDK0OpYq2jn0UwrGZQ5B2XF/gIJ XaUULQLHf7+Va4xixfPcGsXg/HLFr6NBXBhwhMDPUSnf+2DmubJl2JL4c34jClrZ1g3B VsVuWxdw7UfbRU5VXxiww1yWbQrZITj+vw5zUUr256LVGZNfMKeV+tvWxbDOMMygXaqS V6K6CkSeHN7XYxcjCjc0PkAdFje1zFdhbns/kppQLdmke0y+JWGSRso5UftegeuOdYoo 95Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701276786; x=1701881586; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FPGbfDWwX47hn9c1TMZWvz82zmR4+7EsCG8Vv2EabG0=; b=NnLkdzkib0OVz07Eas8ZYbcg2lCONCjv1bo89utiSuDfrF1uPTZ7wXENaS4pvWIAmF QE4L+Xd2anGM2Y+KO7GU5vNJ6zxumlWC68Rj7I0L26+nsL/CNOnJfmyt4or4bLJaFmpg EAnS/++6WECqBBQkd8oY2i/fncyDXMMBUBvKer+Y2/jRUBFJRa1aFjZhXi2RRwm7HBJ4 yFS9k1mTOCmPaEZshHRCQnT1ScnK5D0CBOIYiCOWXYdWi6mazt9Fwu2LSL7FLMAWt844 ufmex09HyQQMhNCRHNNOpvLR4BfSlAIVEPn+WpD9Dhs1kQWWTW1pAl90tPt+c0rheSXZ rtNQ== X-Gm-Message-State: AOJu0Yy1liGwIIVJk7oe/hzJFl1z4UOPSu9mYrR6ojJaxeCA7LUJzxzV UlamF/zbnwf9dlBZ/Kyf89d/ag== X-Google-Smtp-Source: AGHT+IGmGSM5NJDfl50YO5yRCBQhZORbGm64vh+8LM76PvjgpggOwuowAv/8NruJzpZ7nIsrkCFYqA== X-Received: by 2002:a05:690c:26c5:b0:5ce:2148:d4cf with SMTP id eb5-20020a05690c26c500b005ce2148d4cfmr17974677ywb.7.1701276786078; Wed, 29 Nov 2023 08:53:06 -0800 (PST) Received: from aspen.lan ([209.120.180.235]) by smtp.gmail.com with ESMTPSA id kd26-20020a05622a269a00b00421b14f7e7csm5700786qtb.48.2023.11.29.08.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 08:53:05 -0800 (PST) Date: Wed, 29 Nov 2023 11:53:02 -0500 From: Daniel Thompson To: Flavio Suligoi Cc: Lee Jones , Jingoo Han , Helge Deller , Dan Carpenter , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] backlight: mp3309c: fix uninitialized local variable Message-ID: <20231129165302.GA18064@aspen.lan> References: <20231129164514.2772719-1-f.suligoi@asem.it> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129164514.2772719-1-f.suligoi@asem.it> X-Spam-Level: * On Wed, Nov 29, 2023 at 05:45:14PM +0100, Flavio Suligoi wrote: > In the function "pm3309c_parse_dt_node", when the dimming analog control > mode (by I2C messages) is enabled, the local variable "prop_levels" is > tested without any initialization, as indicated by the following smatch > warning: > > drivers/video/backlight/mp3309c.c:279 pm3309c_parse_dt_node() error: uninitialized symbol 'prop_levels'. > > To avoid any problem in case of undefined behavior, we need to initialize > it to "NULL". > > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/dri-devel/af0a1870-693b-442f-9b11-0503cfcd944a@moroto.mountain/ > Fixes: 2e914516a58c ("backlight: mp3309c: Add support for MPS MP3309C") > Signed-off-by: Flavio Suligoi Reviewed-by: Daniel Thompson Daniel. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06932C4167B for ; Wed, 29 Nov 2023 16:53:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 659DB10E63E; Wed, 29 Nov 2023 16:53:10 +0000 (UTC) Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6739D10E63E for ; Wed, 29 Nov 2023 16:53:07 +0000 (UTC) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-5d2d0661a8dso4240127b3.2 for ; Wed, 29 Nov 2023 08:53:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701276786; x=1701881586; darn=lists.freedesktop.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FPGbfDWwX47hn9c1TMZWvz82zmR4+7EsCG8Vv2EabG0=; b=CcbBMR7Et8Q4YcZ2KkXiuNlqbF+BFZ2ibFBZiElPMCvXpZV9Rz5m/+JF4RBItPCQph U9Znme0fRkgKAV+1OIhRwZ4cHdFQztyeiAxchbpIIcJdL5OB/UpssJmESE+MsEnznR9v omszN802ni+S5IS6eeB1NWDIq1IDFaE3cyS6n1Egh8ntl7b6o0dnA3eoEn2MIBkbqUwe zjHHljM+uB9ThGyN3TkIer9InApwN0dV48BFv1REvWkyCR78ZMUXVok5yKJQnfiy06I9 7LRp3xVMh10QvwKjclWx5hDYa+qoeMcs6RhOYXM6XD21k2Lbi/4+orfIIX8kFaMpU3zv sFiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701276786; x=1701881586; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FPGbfDWwX47hn9c1TMZWvz82zmR4+7EsCG8Vv2EabG0=; b=InhlgFuF72ZmMomdQUHQngILn2BpAMJ/GikAANFbvPjZ+HQI8gOlt+8sVwl7OrWWlj pt+lncr8lo5834+JxXtU5IBTLfa/IjJ+RYbGqFVmRC5kn5OriRwqcI8XXHvqDBTUGXPf nCzdpOD5hNuP38/vbNYR3FdHFduil3DLaRdPBx+tDqPygZJOvPYh0ah+KCO2cc+dtGMT Ip64bD3ax4kxOkV8C2xuGVWxIcgGc/Yczk0Na3jHuD+UABgWh81AFf3qscjfGf4Q84iu VpOvz2P99kyJwHumiCTLvOfQyS0WpgmUhb1u8ZYymxvnCLmOrrwH7/M6mkDdkbzj5u2V rI2A== X-Gm-Message-State: AOJu0YwWrYaSs3V0b55bwFlmeN+ADj9w8tjTtvLazbIgqeAizWSHGQR0 6DZYbltw30ntcvkiYamtd1CQtQ== X-Google-Smtp-Source: AGHT+IGmGSM5NJDfl50YO5yRCBQhZORbGm64vh+8LM76PvjgpggOwuowAv/8NruJzpZ7nIsrkCFYqA== X-Received: by 2002:a05:690c:26c5:b0:5ce:2148:d4cf with SMTP id eb5-20020a05690c26c500b005ce2148d4cfmr17974677ywb.7.1701276786078; Wed, 29 Nov 2023 08:53:06 -0800 (PST) Received: from aspen.lan ([209.120.180.235]) by smtp.gmail.com with ESMTPSA id kd26-20020a05622a269a00b00421b14f7e7csm5700786qtb.48.2023.11.29.08.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 08:53:05 -0800 (PST) Date: Wed, 29 Nov 2023 11:53:02 -0500 From: Daniel Thompson To: Flavio Suligoi Subject: Re: [PATCH v2] backlight: mp3309c: fix uninitialized local variable Message-ID: <20231129165302.GA18064@aspen.lan> References: <20231129164514.2772719-1-f.suligoi@asem.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129164514.2772719-1-f.suligoi@asem.it> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Jingoo Han , Helge Deller , Lee Jones , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Dan Carpenter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Nov 29, 2023 at 05:45:14PM +0100, Flavio Suligoi wrote: > In the function "pm3309c_parse_dt_node", when the dimming analog control > mode (by I2C messages) is enabled, the local variable "prop_levels" is > tested without any initialization, as indicated by the following smatch > warning: > > drivers/video/backlight/mp3309c.c:279 pm3309c_parse_dt_node() error: uninitialized symbol 'prop_levels'. > > To avoid any problem in case of undefined behavior, we need to initialize > it to "NULL". > > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/dri-devel/af0a1870-693b-442f-9b11-0503cfcd944a@moroto.mountain/ > Fixes: 2e914516a58c ("backlight: mp3309c: Add support for MPS MP3309C") > Signed-off-by: Flavio Suligoi Reviewed-by: Daniel Thompson Daniel.