Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH -next] [media] go7007: fix invalid use of sizeof in go7007_usb_i2c_master_xfer()
@ 2013-03-26  6:42 Wei Yongjun
  2013-03-26  7:04 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Yongjun @ 2013-03-26  6:42 UTC (permalink / raw)
  To: hans.verkuil, mchehab, gregkh; +Cc: yongjun_wei, linux-media, devel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/staging/media/go7007/go7007-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c
index 0823506..7219ae0 100644
--- a/drivers/staging/media/go7007/go7007-usb.c
+++ b/drivers/staging/media/go7007/go7007-usb.c
@@ -1035,7 +1035,7 @@ static int go7007_usb_i2c_master_xfer(struct i2c_adapter *adapter,
 						buf, buf_len, 0) < 0)
 			goto i2c_done;
 		if (msgs[i].flags & I2C_M_RD) {
-			memset(buf, 0, sizeof(buf));
+			memset(buf, 0, sizeof(*buf));
 			if (go7007_usb_vendor_request(go, 0x25, 0, 0, buf,
 						msgs[i].len + 1, 1) < 0)
 				goto i2c_done;



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-26  8:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-26  6:42 [PATCH -next] [media] go7007: fix invalid use of sizeof in go7007_usb_i2c_master_xfer() Wei Yongjun
2013-03-26  7:04 ` Dan Carpenter
2013-03-26  7:35   ` Dan Carpenter
2013-03-26  8:18     ` Hans Verkuil
2013-03-26  8:30       ` Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox