From b7474cf9f693a83c9a64c8504a08823a34994a2e Mon Sep 17 00:00:00 2001 From: Andoni Zubimendi Date: Wed, 16 Jul 2008 08:40:30 -0300 Subject: [PATCH] V4L/DVB (8361): gspca: Bad check of i2c write to sn9c10x. Signed-off-by: Andoni Zubimendi Signed-off-by: Jean-Francois Moine Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/sonixb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index 054ce4e3ec..80879bf318 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c @@ -456,8 +456,11 @@ static int i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer) while (retry--) { msleep(10); reg_r(gspca_dev, 0x08); - if (gspca_dev->usb_buf[0] == 4) + if (gspca_dev->usb_buf[0] & 0x04) { + if (gspca_dev->usb_buf[0] & 0x08) + return -1; return 0; + } } return -1; } -- 2.39.5