Skip to content

Commit 1adab29

Browse files
Ivan BornyakovShawn Guo
authored andcommitted
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: 52c47b6 ("bus: imx-weim: improve error handling upon child probe-failure") Signed-off-by: Ivan Bornyakov <[email protected]> Cc: [email protected] Reviewed-by: Fabio Estevam <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 62fb541 commit 1adab29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/bus/imx-weim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ static int weim_parse_dt(struct platform_device *pdev)
204204
const struct of_device_id *of_id = of_match_device(weim_id_table,
205205
&pdev->dev);
206206
const struct imx_weim_devtype *devtype = of_id->data;
207+
int ret = 0, have_child = 0;
207208
struct device_node *child;
208-
int ret, have_child = 0;
209209
struct weim_priv *priv;
210210
void __iomem *base;
211211
u32 reg;

0 commit comments

Comments
 (0)