ChangeSet 1.2235, 2005/04/04 08:05:31-07:00, [EMAIL PROTECTED]
[PATCH] Fix Oops in MXB driver (v4l2 subsystem)
This fixes a NULL pointer dereference Oops in my "Multimedia eXtension
Board" driver.
The tda9840 i2c driver dereferences the argument pointer, but the MXB
driver is supplying a NULL pointer for one of the commands. The patch
makes this one command behave like the others, ie. it expects an int
argument.
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
mxb.c | 2 +-
tda9840.c | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff -Nru a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
--- a/drivers/media/video/mxb.c 2005-04-04 09:08:00 -07:00
+++ b/drivers/media/video/mxb.c 2005-04-04 09:08:00 -07:00
@@ -731,7 +731,7 @@
t->signal = 0xffff;
t->afc = 0;
- byte =
mxb->tda9840->driver->command(mxb->tda9840,TDA9840_DETECT, NULL);
+ mxb->tda9840->driver->command(mxb->tda9840,TDA9840_DETECT,
&byte);
t->audmode = mxb->cur_mode;
if( byte < 0 ) {
diff -Nru a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c
--- a/drivers/media/video/tda9840.c 2005-04-04 09:08:00 -07:00
+++ b/drivers/media/video/tda9840.c 2005-04-04 09:08:00 -07:00
@@ -117,7 +117,8 @@
dprintk("i2c_smbus_write_byte() failed, ret:%d\n",
result);
break;
- case TDA9840_DETECT:
+ case TDA9840_DETECT: {
+ int *ret = (int *)arg;
byte = i2c_smbus_read_byte_data(client, STEREO_ADJUST);
if (byte == -1) {
@@ -131,8 +132,10 @@
}
dprintk("TDA9840_DETECT: byte: 0x%02x\n", byte);
- return ((byte & 0x60) >> 5);
-
+ *ret = ((byte & 0x60) >> 5);
+ result = 0;
+ break;
+ }
case TDA9840_TEST:
dprintk("TDA9840_TEST: 0x%02x\n", byte);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html