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 30CB3C6FD18 for ; Tue, 28 Mar 2023 12:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbjC1Mkh (ORCPT ); Tue, 28 Mar 2023 08:40:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbjC1Mkg (ORCPT ); Tue, 28 Mar 2023 08:40:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C1749EF2 for ; Tue, 28 Mar 2023 05:40:13 -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 C3D336164F for ; Tue, 28 Mar 2023 12:39:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D39A1C433EF; Tue, 28 Mar 2023 12:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1680007196; bh=ql3kCtyCNZOhgPniKuu5BjXS4BbJEaAV7jn2mSMGblg=; h=Subject:To:Cc:From:Date:From; b=KQMEr9bS5HEi4p+pfQtDulla6V4QrGfHrYQ5EbNIkDlnpUJU/8qSxY8b6j3FuPEmr dtEerq4c18Z0Fud9gINTtBQmKo8KcqoNskV+Dqg1A6V0REA3lT6ckbBUrPs4t7vgX3 Nk5P8aeN8Rx5UqmGNw0rG4YlLU57CAqHgjLWtfE4= Subject: FAILED: patch "[PATCH] bus: imx-weim: fix branch condition evaluates to a garbage" failed to apply to 5.15-stable tree To: i.bornyakov@metrotek.ru, festevam@gmail.com, shawnguo@kernel.org Cc: From: Date: Tue, 28 Mar 2023 14:39:53 +0200 Message-ID: <16800071933593@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 1adab2922c58e7ff4fa9f0b43695079402cce876 # git commit -s git send-email --to '' --in-reply-to '16800071933593@kroah.com' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: 1adab2922c58 ("bus: imx-weim: fix branch condition evaluates to a garbage value") e6cb5408289f ("bus: imx-weim: add DT overlay support for WEIM bus") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 1adab2922c58e7ff4fa9f0b43695079402cce876 Mon Sep 17 00:00:00 2001 From: Ivan Bornyakov Date: Mon, 6 Mar 2023 16:25:26 +0300 Subject: [PATCH] bus: imx-weim: fix branch condition evaluates to a garbage value 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 Signed-off-by: Shawn Guo diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index 2a6b4f676458..36d42484142a 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;