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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DBEEC74A44 for ; Tue, 14 Mar 2023 03:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229820AbjCNDpL (ORCPT ); Mon, 13 Mar 2023 23:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjCNDpH (ORCPT ); Mon, 13 Mar 2023 23:45:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DFAD1C310; Mon, 13 Mar 2023 20:45:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CC7B5615C6; Tue, 14 Mar 2023 03:45:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B4A1C433D2; Tue, 14 Mar 2023 03:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678765505; bh=ArYrY/9+cCXJxZ6fwPVtoQLz6z4U6hCI/8ZtMgB0F1o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RcOxTyzHAiMued+5V3VfdwpUr7phcyfzAq8QLYBAOOX/xdNydMmc7aMQRGG8N8u0p VSpwTLM992C3CXZmp4BpLn/XFSB1yjgEe5UMhzje7VeE8KHE4LN9cHH6SyJ5bG0zjO aSOUItcSphJsNaw+bjcJMPspTSDtuzwMKxkDYqUchWz3jID7MvvFm/Ip0Y2J7qzlg5 ClxCzTVZt6qWBQmbCNNrckJUFx71IytDu0rnvZiV3NRYZ37xeLFNs9H2/0zMN5zawM BgfbKQKtjDF6kubhxmpvP+zmCAUGKVNxCatkbcIrE7wbDtJ28UmMWULxU6WYNPrtR8 rp2HpEe7fO9DA== Date: Tue, 14 Mar 2023 11:44:58 +0800 From: Shawn Guo To: Ivan Bornyakov Cc: linux-imx@nxp.com, 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 Subject: Re: [PATCH v2] bus: imx-weim: fix branch condition evaluates to a garbage value Message-ID: <20230314034458.GQ143566@dragon> References: <20230306060505.11657-1-i.bornyakov@metrotek.ru> <20230306132526.8763-1-i.bornyakov@metrotek.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230306132526.8763-1-i.bornyakov@metrotek.ru> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 06, 2023 at 04:25:26PM +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. > > Fixes: 52c47b63412b ("bus: imx-weim: improve error handling upon child probe-failure") > Signed-off-by: Ivan Bornyakov > Cc: stable@vger.kernel.org > Reviewed-by: Fabio Estevam Ok, picked this version up instead. 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 9EC68C6FD1F for ; Tue, 14 Mar 2023 03:46:13 +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=o5HMq6RB6ORDbP6FKXGM1AYyvrA9QvJXwyE/ZCQsavA=; b=xV5BDUsHmMS/oO FJL7ZSjo19lUg8vPdAhF36ekLPMGfV5uJJa6B1FQ2B3nSozybK1OWHldjI6hWLBVGQzWrM5YJ9Bmx 7TWg7A8b7n+n3YcYEfmt+m3AL72fgjq/xoQTXeQLn12Ue4XYMMNbGYicDIv6avx4KCllBQUA1eUzW TJXd7kp0rivOqAHLZr0ShA8WXMy0Bstmx8k778r/GFjqdJg1FwJTTLQ24joYL/rfuLOY4A4N0cXmI gm4vQuenq+/0ipIaN31vvurEQAx/BSpUn2t+JgVWJ27FiqcjZm3ZnGwE+ehK5mnspfqfUj5p1S3t4 gGcJ3eGMx5em542aYXzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbvb5-008tTN-KO; Tue, 14 Mar 2023 03:45:11 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbvb2-008tSj-Lf for linux-arm-kernel@lists.infradead.org; Tue, 14 Mar 2023 03:45:09 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CB1BE615C2; Tue, 14 Mar 2023 03:45:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B4A1C433D2; Tue, 14 Mar 2023 03:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678765505; bh=ArYrY/9+cCXJxZ6fwPVtoQLz6z4U6hCI/8ZtMgB0F1o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RcOxTyzHAiMued+5V3VfdwpUr7phcyfzAq8QLYBAOOX/xdNydMmc7aMQRGG8N8u0p VSpwTLM992C3CXZmp4BpLn/XFSB1yjgEe5UMhzje7VeE8KHE4LN9cHH6SyJ5bG0zjO aSOUItcSphJsNaw+bjcJMPspTSDtuzwMKxkDYqUchWz3jID7MvvFm/Ip0Y2J7qzlg5 ClxCzTVZt6qWBQmbCNNrckJUFx71IytDu0rnvZiV3NRYZ37xeLFNs9H2/0zMN5zawM BgfbKQKtjDF6kubhxmpvP+zmCAUGKVNxCatkbcIrE7wbDtJ28UmMWULxU6WYNPrtR8 rp2HpEe7fO9DA== Date: Tue, 14 Mar 2023 11:44:58 +0800 From: Shawn Guo To: Ivan Bornyakov Cc: linux-imx@nxp.com, 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 Subject: Re: [PATCH v2] bus: imx-weim: fix branch condition evaluates to a garbage value Message-ID: <20230314034458.GQ143566@dragon> References: <20230306060505.11657-1-i.bornyakov@metrotek.ru> <20230306132526.8763-1-i.bornyakov@metrotek.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230306132526.8763-1-i.bornyakov@metrotek.ru> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230313_204508_789244_DECA43C6 X-CRM114-Status: GOOD ( 11.50 ) 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 Mon, Mar 06, 2023 at 04:25:26PM +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. > > Fixes: 52c47b63412b ("bus: imx-weim: improve error handling upon child probe-failure") > Signed-off-by: Ivan Bornyakov > Cc: stable@vger.kernel.org > Reviewed-by: Fabio Estevam Ok, picked this version up instead. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel