diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-05-12 17:01:27 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2008-05-12 17:01:27 +0200 |
commit | defea0858dd3f9d9b40638e145776562fcc74c6b (patch) | |
tree | e294e0837521d9c1ac9605f945b931b1a56c480a /linux/drivers/media/video/cx18/cx18-fileops.c | |
parent | 5207c61e188f798fc4ab68d3281596958aa23fcc (diff) | |
download | mediapointer-dvb-s2-defea0858dd3f9d9b40638e145776562fcc74c6b.tar.gz mediapointer-dvb-s2-defea0858dd3f9d9b40638e145776562fcc74c6b.tar.bz2 |
cx18/ivtv: fix open() kernel oops
Andy Walls <awalls@radix.net>
Upon error conditions in cx18/ivtv_probe(), the code at the 'err:' label
leaves a NULL entry in cx18/ivtv_cards[]. This can cause a NULL pointer
de-reference in cx18/ivtv_v4l2_open() which is fixed by this patch.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-fileops.c')
-rw-r--r-- | linux/drivers/media/video/cx18/cx18-fileops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-fileops.c b/linux/drivers/media/video/cx18/cx18-fileops.c index c1db34ff7..f9f025992 100644 --- a/linux/drivers/media/video/cx18/cx18-fileops.c +++ b/linux/drivers/media/video/cx18/cx18-fileops.c @@ -697,6 +697,8 @@ int cx18_v4l2_open(struct inode *inode, struct file *filp) for (x = 0; cx == NULL && x < cx18_cards_active; x++) { /* find out which stream this open was on */ for (y = 0; y < CX18_MAX_STREAMS; y++) { + if (cx18_cards[x] == NULL) + continue; s = &cx18_cards[x]->streams[y]; if (s->v4l2dev && s->v4l2dev->minor == minor) { cx = cx18_cards[x]; |