linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Perry Hooker <perry.hooker@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	ganesh.krishna@microchip.com, linux-kernel@vger.kernel.org,
	aditya.shankar@microchip.com
Subject: Re: [PATCH] staging: wilc1000: use kernel define byte order macros
Date: Wed, 22 Mar 2017 19:53:28 -0600	[thread overview]
Message-ID: <1490234008.66163.1.camel@gmail.com> (raw)
In-Reply-To: <20170322092403.GF32449@mwanda>

I don't think buff is an ieee80211_hdr struct. I think it's the rx_buffer allocated at wilc_wlan.c:1417.

Regards,
Perry

On Wed, 2017-03-22 at 12:24 +0300, Dan Carpenter wrote:
> On Tue, Mar 21, 2017 at 03:40:10PM -0600, Robert Perry Hooker wrote:
> > Thanks for taking a look, Dan. Sorry if I missed the mark here.
> > 
> > Can you tell me a bit more about the bug this would introduce?
> > 
> > I see that ieee80211_is_action is defined like this: static inline bool ieee80211_is_action(__le16 fc)
> > 
> > ...and that buff[FRAME_TYPE_ID]is a u8 (since FRAME_TYPE_ID = 0).
> > 
> > Is there an issue with calling cpu_to_le16 on a u8 that isn't encountered by implicitly casting a u8 to __le16? Or 
> > am I
> > missing something else?
> > 
> 
> Oh...  Hm.  You're right.  I just was thinking that since buff was a
> little endian buffer but it's only reading a u8.  It should probably
> be reading a le16...  The buff likely is just a regular ieee80211_hdr
> struct.
> 
> So you're fixing a bug, but probably not in the right way.  We should
> instead just say "struct ieee80211_hdr *hdr = buff;" and instead of
> treating it like an array of u8.  Probably it requires testing...
> 
> regards,
> dan carpenter
> 

  reply	other threads:[~2017-03-23  1:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 19:55 [PATCH] staging: wilc1000: use kernel define byte order macros Perry Hooker
2017-03-21 20:19 ` Dan Carpenter
2017-03-21 21:40   ` Robert Perry Hooker
2017-03-22  9:24     ` Dan Carpenter
2017-03-23  1:53       ` Robert Perry Hooker [this message]
2017-03-23  8:33         ` Dan Carpenter
2017-03-23 22:15           ` Robert Perry Hooker
2017-03-24  8:57             ` Dan Carpenter
2017-04-10 19:36               ` perry

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=1490234008.66163.1.camel@gmail.com \
    --to=perry.hooker@gmail.com \
    --cc=aditya.shankar@microchip.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=ganesh.krishna@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).