staging: greybus: audio: Uninitialized variable in gbaudio_remove_controls()
Subsystems (3)
PATCH 1/1 staging: greybus: audio: Uninitialized variable in gbaudio_remove_controls()
The "err" variable is not meaningful so there is no need to print it. It's uninitialized on the first iteration through the loop.
Fixes 510e340efe0c ("staging: greybus: audio: Add helper APIs for dynamic audio modules")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/staging/greybus/audio_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/greybus/audio_helper.c +1 -2
@@ -173,8 +173,7 @@ static int gbaudio_remove_controls(struct snd_card *card, struct device *dev, id.index = control->index; kctl =snd_ctl_find_id (card, &id);if (!kctl) { -dev_err (dev,"%d: Failed to find %s\n" , err, - control->name); +dev_err (dev,"Failed to find %s\n" , control->name);continue ; } err =snd_ctl_remove (card, kctl);
Signature · 1 line
2.27.0
Quoted 6 lines · Dan Carpenter
The "err" variable is not meaningful so there is no need to print it. It's uninitialized on the first iteration through the loop.
Fixes 510e340efe0c ("staging: greybus: audio: Add helper APIs for dynamic audio modules")Signed-off-by Dan Carpenter <[email protected]>
Thanks Dan for sharing this patch.
Reviewed-by Vaibhav Agarwal <[email protected]>
Quoted 21 lines
--- drivers/staging/greybus/audio_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/staging/greybus/audio_helper.c +1
-3@@ -173,8 +173,7 @@ static int gbaudio_remove_controls(struct snd_card *card, struct device *dev, id.index = control->index; kctl =snd_ctl_find_id (card, &id);if (!kctl) { -dev_err (dev,"%d: Failed to find %s\n" , err, - control->name); +dev_err (dev,"Failed to find %s\n" , control->name);continue ; } err =snd_ctl_remove (card, kctl); --2.27.0
Re: [greybus-dev] [PATCH] staging: greybus: audio: Uninitialized variable in gbaudio_remove_controls
In reply to Dan CarpenterQuoted 5 lines · Dan Carpenter
The "err" variable is not meaningful so there is no need to print it. It's uninitialized on the first iteration through the loop.
Fixes 510e340efe0c ("staging: greybus: audio: Add helper APIs for dynamic audio modules")Signed-off-by Dan Carpenter <[email protected]>
This is a good fix, thanks.
Reviewed-by Alex Elder <[email protected]>
Quoted 19 lines
--- drivers/staging/greybus/audio_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/staging/greybus/audio_helper.c +1
-2@@ -173,8 +173,7 @@ static int gbaudio_remove_controls(struct snd_card *card, struct device *dev, id.index = control->index; kctl =snd_ctl_find_id (card, &id);if (!kctl) { -dev_err (dev,"%d: Failed to find %s\n" , err, - control->name); +dev_err (dev,"Failed to find %s\n" , control->name);continue ; } err =snd_ctl_remove (card, kctl);