aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-alsa-main.c
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2010-01-06 22:52:39 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:44 -0500
commitc71fd169a13d34f26997b27183b510e0b7fc2623 (patch)
treeea54d454a3dde270a11fbdd6bf0edfa87ac2fad9 /drivers/media/video/cx18/cx18-alsa-main.c
parent60433e2ab8391d1884ddef2269bd19ecdaaa2d72 (diff)
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: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-alsa-main.c')
-rw-r--r--drivers/media/video/cx18/cx18-alsa-main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/cx18/cx18-alsa-main.c b/drivers/media/video/cx18/cx18-alsa-main.c
index 2b72f42e8461..9efabf5e260f 100644
--- a/drivers/media/video/cx18/cx18-alsa-main.c
+++ b/drivers/media/video/cx18/cx18-alsa-main.c
@@ -134,7 +134,7 @@ static int __init snd_cx18_card_set_names(struct snd_cx18_card *cxsc)
134static int __init snd_cx18_init(struct v4l2_device *v4l2_dev) 134static int __init snd_cx18_init(struct v4l2_device *v4l2_dev)
135{ 135{
136 struct cx18 *cx = to_cx18(v4l2_dev); 136 struct cx18 *cx = to_cx18(v4l2_dev);
137 struct snd_card *sc; 137 struct snd_card *sc = NULL;
138 struct snd_cx18_card *cxsc; 138 struct snd_cx18_card *cxsc;
139 int ret; 139 int ret;
140 140
@@ -189,7 +189,8 @@ static int __init snd_cx18_init(struct v4l2_device *v4l2_dev)
189 return 0; 189 return 0;
190 190
191err_exit_free: 191err_exit_free:
192 snd_card_free(sc); 192 if (sc != NULL)
193 snd_card_free(sc);
193err_exit: 194err_exit:
194 return ret; 195 return ret;
195} 196}