From patchwork Tue Mar 26 06:42:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2335001 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C508C3FC54 for ; Tue, 26 Mar 2013 06:42:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756564Ab3CZGmu (ORCPT ); Tue, 26 Mar 2013 02:42:50 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:62625 "EHLO mail-bk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753784Ab3CZGmt (ORCPT ); Tue, 26 Mar 2013 02:42:49 -0400 Received: by mail-bk0-f44.google.com with SMTP id jk13so436972bkc.17 for ; Mon, 25 Mar 2013 23:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=G5IoRzicPtdkc3T5BBH4uHpGYlHnyXEbkaERi7Y5J0U=; b=WT5gnKzV3qdkeOydblpvAzn++mVdkRdsfkGk89fSoJvHX9NJ2ieRzNC+v0twiA8SBS D0rGj29l2bQS4UyEQr2TMNIrb0bAvt0rqRxkjwgVB7gskYZlsZwzoK7mhHY4Xlv57m1R sCB9+nQIx0X/6tM7/edjAq2D3hLFMguIDLR925MbvB2u9B46frBE8E+9FqVlHr4l6DLE P2ATOrsZK1Oi14lfe/HknuxrX7aQ0CBeepSkPZArf2SwpWr4xydi6zmBYQu30sdLSSZR a/o6I3KQ6afAGbumt1ycBvJ8mNP6MzYn99UzkMt0fQUhvftH5zcNiDsj2ut26ABlYhK/ Y6Xg== MIME-Version: 1.0 X-Received: by 10.204.243.3 with SMTP id lk3mr6838040bkb.38.1364280168169; Mon, 25 Mar 2013 23:42:48 -0700 (PDT) Received: by 10.204.30.210 with HTTP; Mon, 25 Mar 2013 23:42:47 -0700 (PDT) Date: Tue, 26 Mar 2013 14:42:47 +0800 Message-ID: Subject: [PATCH -next] [media] go7007: fix invalid use of sizeof in go7007_usb_i2c_master_xfer() From: Wei Yongjun To: hans.verkuil@cisco.com, mchehab@redhat.com, gregkh@linuxfoundation.org Cc: yongjun_wei@trendmicro.com.cn, linux-media@vger.kernel.org, devel@driverdev.osuosl.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Wei Yongjun 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 --- drivers/staging/media/go7007/go7007-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;