Skip to content

Commit

Permalink
V4L/DVB: cx18: address possible passing of NULL to snd_card_free
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent 60433e2 commit c71fd16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/video/cx18/cx18-alsa-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c71fd16

Please sign in to comment.