From: Devin Heitmueller Date: Thu, 7 Jan 2010 03:52:39 +0000 (-0300) Subject: V4L/DVB: cx18: address possible passing of NULL to snd_card_free X-Git-Tag: v2.6.34-rc1~280^2~201 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c71fd169a13d34f26997b27183b510e0b7fc2623;p=~emulex%2Finfiniband.git 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 Signed-off-by: Devin Heitmueller Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/cx18/cx18-alsa-main.c b/drivers/media/video/cx18/cx18-alsa-main.c index 2b72f42e846..9efabf5e260 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) static int __init snd_cx18_init(struct v4l2_device *v4l2_dev) { struct cx18 *cx = to_cx18(v4l2_dev); - struct snd_card *sc; + struct snd_card *sc = NULL; struct snd_cx18_card *cxsc; int ret; @@ -189,7 +189,8 @@ static int __init snd_cx18_init(struct v4l2_device *v4l2_dev) return 0; err_exit_free: - snd_card_free(sc); + if (sc != NULL) + snd_card_free(sc); err_exit: return ret; }