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 8BDFAC6FD18 for ; Tue, 28 Mar 2023 12:40:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230363AbjC1Mkq (ORCPT ); Tue, 28 Mar 2023 08:40:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232371AbjC1Mkn (ORCPT ); Tue, 28 Mar 2023 08:40:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB21086BE for ; Tue, 28 Mar 2023 05:40:23 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2FB96B81CA7 for ; Tue, 28 Mar 2023 12:40:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75142C433EF; Tue, 28 Mar 2023 12:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1680007204; bh=WtGj05aW2h7J39wnzLInOCCtGFqHSLieIXN2KC7a9Rk=; h=Subject:To:Cc:From:Date:From; b=z7YoKQHiteQrBxGzUUf1rlg2DD9CEd8WDcr4L7USaZu1A6y2eyqTrGcMGeFbD+fau 53CwZGyd3azqdxGI5nWrWQmlGViTQZbkelgnAYAkNC47+kv5TPhaD5NwWSbV0Zysru 7ljOnEisZ8KUKFNdn8QXPX/jlErDkcp5OBMucI8s= Subject: FAILED: patch "[PATCH] bus: imx-weim: fix branch condition evaluates to a garbage" failed to apply to 5.4-stable tree To: i.bornyakov@metrotek.ru, festevam@gmail.com, shawnguo@kernel.org Cc: From: Date: Tue, 28 Mar 2023 14:39:55 +0200 Message-ID: <1680007195157101@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.4-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.4.y git checkout FETCH_HEAD git cherry-pick -x 1adab2922c58e7ff4fa9f0b43695079402cce876 # git commit -s git send-email --to '' --in-reply-to '1680007195157101@kroah.com' --subject-prefix 'PATCH 5.4.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;