From: Dan Carpenter <dan.carpenter@oracle.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: hans.verkuil@cisco.com, mchehab@redhat.com,
gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
yongjun_wei@trendmicro.com.cn, linux-media@vger.kernel.org
Subject: Re: [PATCH -next] [media] go7007: fix invalid use of sizeof in go7007_usb_i2c_master_xfer()
Date: Tue, 26 Mar 2013 10:04:15 +0300 [thread overview]
Message-ID: <20130326070415.GH9138@mwanda> (raw)
In-Reply-To: <CAPgLHd-+DNxxVHsXiJpk2KFk8mzrQUkwaYPUFeWHyAmz-H6=4Q@mail.gmail.com>
On Tue, Mar 26, 2013 at 02:42:47PM +0800, Wei Yongjun wrote:
> 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.
>
This fix isn't right. "buf" is a char pointer. I don't know what
this code is doing. Instead of sizeof(*buf) it should be something
like "buflen", "msg[i].len", "msg[i].len + 1" or "msg[i].len + 3".
I'm not sure which is correct here or what it's doing, sorry.
regards,
dan carpenter
next prev parent reply other threads:[~2013-03-26 7:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2013-03-26 7:35 ` Dan Carpenter
2013-03-26 8:18 ` Hans Verkuil
2013-03-26 8:30 ` Wei Yongjun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130326070415.GH9138@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=weiyj.lk@gmail.com \
--cc=yongjun_wei@trendmicro.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.