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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 31D5BC61DA3 for ; Fri, 24 Feb 2023 06:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rrtvV/53PtjoU5ppcm/jj+hN82bPPf4jY0x0ffe0HMA=; b=RSH7/iXIMh1ibM rAlQyv3Srjsq2XLFif5T/+g9G1ppdKiZBdz8+oSn8mhItVAskfuGAWZd85xtblEcaTBZCvdOroBw+ o+VVkKIP1WVM4XcrAvAGU6oK7hjP0aPr8XK13ZGeikb5JLMZyKgtv8Ha6WO7B0sEZb2uzptHVxvHR kHG2hSITmKoww6du4ynKVSWn8GUSrtBVcudmAfQfgeTdF9454DmPKQ2du3IeXjovhdvScpc8bE4vo 7KjADoCPZphrXz6LPuOrx3vxY1JB0nx50yQh9Jm17IVIwE9PHfCcG/ncfZOLob+zEZjcB1hkBptM9 YfBkl83R8hT8g2dzTuPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pVRDQ-001JIW-Dg; Fri, 24 Feb 2023 06:05:56 +0000 Received: from mail.pr-group.ru ([178.18.215.3]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pVRDM-001JHf-KU for linux-arm-kernel@lists.infradead.org; Fri, 24 Feb 2023 06:05:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=metrotek.ru; s=mail; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to: references; bh=DwB4bZQaxHRrB6/01TuUbnnpQzCfQyELJ/MBwWdHYLk=; b=OtePABwO+4nnCdtiXEGiENgYvGISGzt9y4BaJucmwlKca70ucVk4Cbs0XF+FYmFQHvQR4uwTJKNAn ZvOTeKPaaU7kPAD+nfBJDTb48UGMZ+GtyNVXQ0ZdusZZHuqRhsxF1z5Sx57h7HxJnwFh4QfGbpsIZ+ DHlUaQooI30rpoQ9YGVm2cb9+IuwCwMTpFaXiMAfX/6j+P71/LWpecmzL8PGHQwxLTQaZzSdHbv7X3 ejHJk7urcF9DYcAz85DPblCantYbRRhc9VT/hoJwCLWgzjgNrbBOlqr7bMHKyYt+5eT5y5cVCyuHEB rvGgU0ikPTI1oS+Uqvd6taFfcfoXV1Q== X-Kerio-Anti-Spam: Build: [Engines: 2.17.1.1470, Stamp: 3], Multi: [Enabled, t: (0.000009,0.007284)], BW: [Enabled, t: (0.000020,0.000001)], RTDA: [Enabled, t: (0.081105), Hit: No, Details: v2.48.0; Id: 15.rwhmc.1gq10e01v.2ep; mclb], total: 0(700) X-Footer: bWV0cm90ZWsucnU= Received: from x260 ([78.37.166.219]) (authenticated user i.bornyakov@metrotek.ru) by mail.pr-group.ru with ESMTPSA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)); Fri, 24 Feb 2023 09:05:40 +0300 Date: Fri, 24 Feb 2023 09:05:36 +0300 From: Ivan Bornyakov To: linux-imx@nxp.com Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, i.bornyakov@metrotek.ru Subject: Re: [PATCH] bus: imx-weim: fix branch condition evaluates to a garbage value Message-ID: <20230224060536.e5v5ltxkfqava2ia@x260> References: <20230217135950.19469-1-i.bornyakov@metrotek.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230217135950.19469-1-i.bornyakov@metrotek.ru> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230223_220553_239030_BBE2D5A5 X-CRM114-Status: GOOD ( 17.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 17, 2023 at 04:59:50PM +0300, Ivan Bornyakov wrote: > If bus type is other than imx50_weim_devtype and have no child devices, > variable 'ret' in function weim_parse_dt() will not be initialized, but > will be used as branch condition and return value. Fix this by > initializing 'ret' with 0. > > This was discovered with help of clang-analyzer, but the situation is > quite possible in real life. > > Signed-off-by: Ivan Bornyakov > Cc: stable@vger.kernel.org > --- > drivers/bus/imx-weim.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c > index 828c66bbaa67..55d917bd1f3f 100644 > --- a/drivers/bus/imx-weim.c > +++ b/drivers/bus/imx-weim.c > @@ -204,8 +204,8 @@ static int weim_parse_dt(struct platform_device *pdev) > const struct of_device_id *of_id = of_match_device(weim_id_table, > &pdev->dev); > const struct imx_weim_devtype *devtype = of_id->data; > + int ret = 0, have_child = 0; > struct device_node *child; > - int ret, have_child = 0; > struct weim_priv *priv; > void __iomem *base; > u32 reg; > -- > 2.39.2 > Friendly ping. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel