From: Dan Carpenter <dan.carpenter@oracle.com>
To: Malcolm Priestley <tvboxspy@gmail.com>
Cc: Martin Alonso <martin.alonso@zoho.com>,
pasteka@kabsi.at, devel@driverdev.osuosl.org,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
forest@alittletooquiet.net, joe@perches.com
Subject: Re: [PATCH 2/2] staging: vt6656: Make 'rx_rate' u8 instead of u8 *
Date: Fri, 30 Sep 2016 22:37:47 +0300 [thread overview]
Message-ID: <20160930193747.GB26713@mwanda> (raw)
In-Reply-To: <8775808f-5a21-af7a-4e32-126d231dd681@gmail.com>
On Fri, Sep 30, 2016 at 07:53:00PM +0100, Malcolm Priestley wrote:
> On 28/09/16 08:40, Dan Carpenter wrote:
> >On Tue, Sep 27, 2016 at 02:52:49PM -0300, Martin Alonso wrote:
> >>Change the type and uses of rx_rate.
> >>
> >>Signed-off-by: Martin Alonso <martin.alonso@zoho.com>
> >>---
> >> drivers/staging/vt6656/dpc.c | 9 +++++----
> >> 1 file changed, 5 insertions(+), 4 deletions(-)
> >>
> >>diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
> >>index 655f000..782b7d7 100644
> >>--- a/drivers/staging/vt6656/dpc.c
> >>+++ b/drivers/staging/vt6656/dpc.c
> >>@@ -46,7 +46,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
> >> __le64 *tsf_time;
> >> u32 frame_size;
> >> int ii, r;
> >>- u8 *rx_rate, *sq, *sq_3;
> >>+ u8 rx_rate;
> >>+ u8 *sq, *sq_3;
> >> u32 wbk_status;
> >> u8 *skb_data;
> >> u16 *pay_load_len;
> >>@@ -75,7 +76,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
> >>
> >> skb_data = (u8 *)skb->data;
> >>
> >>- rx_rate = skb_data + 5;
> >>+ rx_rate = *(skb_data + 5);
> >
> >It occurs to me that we don't check that skb->len is large enough here.
> >We just assume it has at least 5 bytes.
> >
> >TODO: vt6656: verify skb->len before using it.
>
> skb->len is always set to the tail room then trimmed by this function.
>
We call skb_trim() after assuming it's at least 5 bytes so that doesn't
matter for this discussion?
regards,
dan carpenter
next prev parent reply other threads:[~2016-09-30 19:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 17:48 [PATCH] staging: vt6656: Add spaces around '+' operator Martin Alonso
2016-09-26 18:02 ` Joe Perches
2016-09-27 16:59 ` Martin Alonso
2016-09-27 17:52 ` [PATCH 1/2] staging: vt6656: Remove unused variable 'rx_sts' Martin Alonso
2016-09-27 17:52 ` [PATCH 2/2] staging: vt6656: Make 'rx_rate' u8 instead of u8 * Martin Alonso
2016-09-28 7:40 ` Dan Carpenter
2016-09-30 18:53 ` Malcolm Priestley
2016-09-30 19:37 ` Dan Carpenter [this message]
2016-09-28 9:34 ` Greg KH
2016-09-27 11:10 ` [PATCH] staging: vt6656: Add spaces around '+' operator Greg KH
2016-09-27 11:49 ` Martin Alonso
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=20160930193747.GB26713@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=forest@alittletooquiet.net \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.alonso@zoho.com \
--cc=pasteka@kabsi.at \
--cc=tvboxspy@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox