ASoC: SOF: topology: Fix missing error code in sof_route_load()
Subsystems (3)
PATCH 1/1 ASoC: SOF: topology: Fix missing error code in sof_route_load()
The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'err'.
sound/soc/sof/topology.c:2060 sof_route_load() warn: missing error code 'ret'.
--- sound/soc/sof/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/sof/topology.c +2 -2
@@ -2045,7 +2045,6 @@ static int sof_route_load(struct snd_soc_component *scomp, int index,if (!source_swidget) {dev_err (scomp->dev,"error: source %s not found\n" , route->source); - ret = -EINVAL ; goto err; }
@@ -2064,7 +2063,6 @@ static int sof_route_load(struct snd_soc_component *scomp, int index,if (!sink_swidget) {dev_err (scomp->dev,"error: sink %s not found\n" , route->sink); - ret = -EINVAL ; goto err; }
@@ -2087,6 +2085,8 @@ static int sof_route_load(struct snd_soc_component *scomp, int index,return 0 ; err:kfree (sroute); + ret = -EINVAL ; +return ret; }
Signature · 1 line
2.20.1.7.g153144c
Quoted 4 lines · Jiapeng Chong
The error code is missing in this code scenario, add the error code '
-EINVAL' to the return value 'err'.
sound/soc/sof/topology.c:2060sof_route_load()warn: missing error
code 'ret'.
Quoted 2 lines
Reported-by Abaci Robot <[email protected]>
Robots don't necessarily understand code...
The cases which this is aiming to fix are the cases when we ignore things, not failing.
Would it be possible to check the code and understand it before sending a patch?
Nack.
sound/soc/sof/topology.c static int sof_route_load(struct
Quoted 11 lines
Signed-off-by Jiapeng Chong <[email protected]>--- sound/soc/sof/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)sound/soc/sof/topology.c +0
-0@@ -2045,7 +2045,6 @@ static int sof_route_load(struct
snd_soc_component *scomp, int index,
sound/soc/sof/topology.c static int sof_route_load(struct
Quoted 8 lines
sound/soc/sof/topology.c +0
-1if (!source_swidget) {dev_err (scomp->dev,"error: source %s not found\n" , route->source); - ret = -EINVAL ; goto err; }@@ -2064,7 +2063,6 @@ static int sof_route_load(struct
snd_soc_component *scomp, int index,
sound/soc/sof/topology.c static int sof_route_load(struct
Quoted 8 lines
sound/soc/sof/topology.c +0
-1if (!sink_swidget) {dev_err (scomp->dev,"error: sink %s not found\n" , route->sink); - ret = -EINVAL ; goto err; }@@ -2087,6 +2085,8 @@ static int sof_route_load(struct
snd_soc_component *scomp, int index,
Quoted 8 lines
sound/soc/sof/topology.c +2
-0return 0 ; err:kfree (sroute); + ret = -EINVAL ; +return ret; }
Signature · 1 line
Péter