media: go7007: fix a miss of snd_card_free
Subsystems (2)
PATCH 1/1 media: go7007: fix a miss of snd_card_free
go7007_snd_init() misses a snd_card_free() in an error path. Add the missed call to fix it.
--- drivers/media/usb/go7007/snd-go7007.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/usb/go7007/snd-go7007.c +1 -0
@@ -243,6 +243,7 @@ int go7007_snd_init(struct go7007 *go) ret =snd_device_new (gosnd->card,SNDRV_DEV_LOWLEVEL , go, &go7007_snd_device_ops);if (ret <0 ) { +snd_card_free (gosnd->card);kfree (gosnd);return ret; }
Signature · 1 line
2.24.0
Quoted 2 lines
go7007_snd_init()misses asnd_card_free()in an error path. Add the missed call to fix it.
How do you think about to take another look also at the previous update suggestion “[PATCH 5/6] [media] go7007: Use common error handling code in go7007_snd_init()”?
https://lore.kernel.org/linux-media/[email protected]/
https://lore.kernel.org/patchwork/patch/831887/
https://lkml.org/lkml/2017/9/19/115
Regards,
Markus
Quoted 10 lines · Markus Elfring
Quoted 3 lines
go7007_snd_init()misses asnd_card_free()in an error path. Add the missed call to fix it.How do you think about to take another look also at the previous update suggestion “[PATCH 5/6] [media] go7007: Use common error handling code in go7007_snd_init()”?
https://lore.kernel.org/linux-media/[email protected]/
https://lore.kernel.org/patchwork/patch/831887/
https://lkml.org/lkml/2017/9/19/115
I think using goto is really much better than freeing after every error. I will send a new version if others also agree with this pattern.
Regards,
Chuhong
Quoted 2 lines
Regards,
Markus
Quoted 1 line
I think using goto is really much better than freeing after every error.
Thanks for your positive feedback.
Quoted 1 line
I will send a new version if others also agree with this pattern.
* The error handling pattern would be supported by the Linux coding style. The agreement on corresponding changes can occasionally become more challenging.
* I would interpret Dan Carpenter's review comment (from 2017-09-19) in the way that he should be mentioned by the tag “Reported-by” in a subsequent patch.
https://lkml.org/lkml/2017/9/19/115
Regards,
Markus