Skip to content

Commit 3cc393d

Browse files
tq-steinabroonie
authored andcommitted
ASoC: simple-card-utils: Fix pointer check in graph_util_parse_link_direction
Actually check if the passed pointers are valid, before writing to them. This also fixes a USBAN warning: UBSAN: invalid-load in ../sound/soc/fsl/imx-card.c:687:25 load of value 255 is not a valid value for type '_Bool' This is because playback_only is uninitialized and is not written to, as the playback-only property is absent. Fixes: 844de7e ("ASoC: audio-graph-card2: expand dai_link property part") Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://patch.msgid.link/20250429094910.1150970-1-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 95b2536 commit 3cc393d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/generic/simple-card-utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,9 +1174,9 @@ void graph_util_parse_link_direction(struct device_node *np,
11741174
bool is_playback_only = of_property_read_bool(np, "playback-only");
11751175
bool is_capture_only = of_property_read_bool(np, "capture-only");
11761176

1177-
if (is_playback_only)
1177+
if (playback_only)
11781178
*playback_only = is_playback_only;
1179-
if (is_capture_only)
1179+
if (capture_only)
11801180
*capture_only = is_capture_only;
11811181
}
11821182
EXPORT_SYMBOL_GPL(graph_util_parse_link_direction);

0 commit comments

Comments
 (0)