From: Gerd Knorr Date: Wed, 25 May 2005 19:31:26 +0000 (-0700) Subject: [PATCH] v4l: bttv i2c oops fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5daf05fbf73fc199e7a93a818e504856d07c5586;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [PATCH] v4l: bttv i2c oops fix Don't try to access the i2c bus if the register wasn't successful. Signed-off-by: Gerd Knorr Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c index e3f477dff827..c2368bc832ed 100644 --- a/drivers/media/video/bttv-i2c.c +++ b/drivers/media/video/bttv-i2c.c @@ -363,6 +363,9 @@ int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1, /* read EEPROM content */ void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr) { + memset(eedata, 0, 256); + if (0 != btv->i2c_rc) + return; btv->i2c_client.addr = addr >> 1; tveeprom_read(&btv->i2c_client, eedata, 256); }