Skip to contentSkip to conversation

FAILED: patch "[PATCH] bus: imx-weim: fix branch condition evaluates to a garbage" failed to apply to 4.19-stable tree

PATCH [email protected] 1 participant 1 message Mar 28, 2023

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.19-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 <[email protected]>.

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-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 1adab2922c58e7ff4fa9f0b43695079402cce876
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 4.19.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") 3b1261fb72c7 ("bus: imx-weim: remove incorrect __init annotations") 4a92f07816ba ("bus: imx-weim: use module_platform_driver()") 77266e722fea ("bus: imx-weim: optionally enable burst clock mode") c7995bcb36ef ("bus: imx-weim: guard against timing configuration conflicts") 8b8cb52af34d ("bus: imx-weim: support multiple address ranges per child node") b1a23445364d ("bus: imx-weim: drop unnecessary DT node name NULL check")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 1adab2922c58e7ff4fa9f0b43695079402cce876 Mon Sep 17 00:00:00 2001
From: Ivan Bornyakov <[email protected]>
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")
drivers/bus/imx-weim.c +1 -1
index 2a6b4f676458..36d42484142a 100644
@@ -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;