Skip to content

Commit

Permalink
ASoC: audio-graph-card: add missing const at graph_get_dai_id()
Browse files Browse the repository at this point in the history
commit c152f84 ("ASoC: audio-graph-card: fix an use-after-free in
graph_get_dai_id()") fixups use-after-free issue,
but, it need to use "const" for reg. This patch adds it.

We will have below without this patch

LINUX/sound/soc/generic/audio-graph-card.c: In function 'graph_get_dai_id':
LINUX/sound/soc/generic/audio-graph-card.c:87:7: warning: assignment discards\
 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   reg = of_get_property(node, "reg", NULL);

Fixes: c152f84 ("ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()")
Signed-off-by: Kuninori Morimoto <[email protected]>
Acked-by: Wen Yang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
morimoto authored and broonie committed Jul 11, 2019
1 parent 09297c2 commit ec3042a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/generic/audio-graph-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static int graph_get_dai_id(struct device_node *ep)
struct device_node *endpoint;
struct of_endpoint info;
int i, id;
u32 *reg;
const u32 *reg;
int ret;

/* use driver specified DAI ID if exist */
Expand Down

0 comments on commit ec3042a

Please sign in to comment.