All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Julia Lawall <julia@diku.dk>
Cc: Ivo van Doorn <IvDoorn@gmail.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: Re: [PATCH 5/9] drivers/net/wireless: Correct code taking the size of a pointer
Date: Sun, 13 Dec 2009 13:55:26 +0100	[thread overview]
Message-ID: <m2iqcbt4n5.fsf@igel.home> (raw)
In-Reply-To: <Pine.LNX.4.64.0912131241470.24267@ask.diku.dk> (Julia Lawall's message of "Sun, 13 Dec 2009 12:42:07 +0100 (CET)")

Julia Lawall <julia@diku.dk> writes:

> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index eb1e1d0..1e74732 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2140,8 +2140,8 @@ static void rt2800_get_tkip_seq(struct ieee80211_hw *hw, u8 hw_key_idx,
>  	rt2800_register_multiread(rt2x00dev, offset,
>  				      &iveiv_entry, sizeof(iveiv_entry));
>  
> -	memcpy(&iveiv_entry.iv[0], iv16, sizeof(iv16));
> -	memcpy(&iveiv_entry.iv[4], iv32, sizeof(iv32));
> +	memcpy(&iveiv_entry.iv[0], iv16, sizeof(*iv16));
> +	memcpy(&iveiv_entry.iv[4], iv32, sizeof(*iv32));

That still looks pretty bogus, the memcpy calls are overwriting the
values written by the previous rt2800_register_multiread call.  Most
likely the first two arguments need to be swapped.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2009-12-13 12:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13 11:42 [PATCH 5/9] drivers/net/wireless: Correct code taking the size of Julia Lawall
2009-12-13 11:42 ` [PATCH 5/9] drivers/net/wireless: Correct code taking the size of a pointer Julia Lawall
2009-12-13 12:55 ` Andreas Schwab [this message]
2009-12-13 13:10   ` Julia Lawall
2009-12-13 16:07   ` Julia Lawall
2009-12-14 22:07     ` Gertjan van Wingerde
2009-12-15 17:09       ` Ivo van Doorn
2009-12-13 16:08   ` Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2009-12-13 11:42 Julia Lawall

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=m2iqcbt4n5.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=IvDoorn@gmail.com \
    --cc=gwingerde@gmail.com \
    --cc=julia@diku.dk \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.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 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.