Commit c71fd169 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB: cx18: address possible passing of NULL to snd_card_free

Eliminate the possibility of passing NULL to snd_card_free().

Thanks to Takashi Iwai for reviewing and pointing this out.

This work was sponsored by ONELAN Limited.

Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 60433e2a
...@@ -134,7 +134,7 @@ static int __init snd_cx18_card_set_names(struct snd_cx18_card *cxsc) ...@@ -134,7 +134,7 @@ static int __init snd_cx18_card_set_names(struct snd_cx18_card *cxsc)
static int __init snd_cx18_init(struct v4l2_device *v4l2_dev) static int __init snd_cx18_init(struct v4l2_device *v4l2_dev)
{ {
struct cx18 *cx = to_cx18(v4l2_dev); struct cx18 *cx = to_cx18(v4l2_dev);
struct snd_card *sc; struct snd_card *sc = NULL;
struct snd_cx18_card *cxsc; struct snd_cx18_card *cxsc;
int ret; int ret;
...@@ -189,6 +189,7 @@ static int __init snd_cx18_init(struct v4l2_device *v4l2_dev) ...@@ -189,6 +189,7 @@ static int __init snd_cx18_init(struct v4l2_device *v4l2_dev)
return 0; return 0;
err_exit_free: err_exit_free:
if (sc != NULL)
snd_card_free(sc); snd_card_free(sc);
err_exit: err_exit:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment