[PATCH] Fixed typo in sizeof() causing NULL pointer OOPS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've found problem with memset() method in saa7134-cards.c. It causes "BUG: 
unable to handle kernel NULL pointer dereference at 00000000" during 
saa7134/xc2028 initialization.

The solution is simple: use correct sizeof() in memset().

Patch attached. I created it against 
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git tree.

Regards,
Oldrich.
commit 0d996babd6046b54d5a9194ea94ec7971adb0d17
Author: OldÅ?ich JedliÄ?ka <oldium.pro@xxxxxxxxx>
Date:   Thu Nov 13 20:50:31 2008 +0100

    Fixed typo in sizeof() causing NULL pointer OOPS
    
    Signed-off-by: OldÅ?ich JedliÄ?ka <oldium.pro@xxxxxxxxx>

diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index ddc5402..8635228 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -6048,7 +6048,7 @@ static void saa7134_tuner_setup(struct saa7134_dev *dev)
 		struct v4l2_priv_tun_config  xc2028_cfg;
 		struct xc2028_ctrl           ctl;
 
-		memset(&xc2028_cfg, 0, sizeof(ctl));
+		memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
 		memset(&ctl, 0, sizeof(ctl));
 
 		ctl.fname   = XC2028_DEFAULT_FIRMWARE;
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux