All of lore.kernel.org
 help / color / mirror / Atom feed
From: dan.carpenter@oracle.com (Dan Carpenter)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC v2 1/1] RTL8712 alignment bug in 3.6 and up on ARMV5
Date: Sat, 15 Dec 2012 22:43:24 +0300	[thread overview]
Message-ID: <20121215194324.GD5032@mwanda> (raw)
In-Reply-To: <CAMW5UfZmptBK5sLq3zMdPJ6C3Arqfyy4SY5BOPfqcOB1T-sbSg@mail.gmail.com>

Thanks for fixing this bug.  Your patch works but it's not the right
way to do it.

The original code here adds 4 to pointers which are currently
aligned instead of leaving them as is.  We have a kernel ALIGN()
macro which works correctly, but actually, it's not needed.

On arm, the pointer returned from kmalloc() is already aligned at
the 8 byte boundary because "#define ARCH_SLAB_MINALIGN 8".  The
original code always adds 4 to the pointer so everything is
misaligned.

Your patch adds another 4 bytes so it is now aligned at the 8 byte
boundary again.  That works, of course, but it's better to remove
the whole mess.

	pstapriv->pallocated_stainfo_buf = kmalloc(sizeof(struct sta_info) * NUM_STA);

Get rid of the ->pstainfo_buf pointer which is only used to store
the "aligned" version of ->pallocated_stainfo_buf.

Please send a version which applies with "git am" and has the proper
sign-off.  Sent it to yourself first.  Save the raw email (including
headers and everything).
	cat raw_email.txt | git am
Type "git log -p" to verify that the commit message looks good.
Then resend it to the list.

Thanks again.  This is a good bugfix.

regards,
dan carpenter

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Josh Coombs <josh.coombs@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	devel@driverdev.osuosl.org, florian.c.schilhabel@googlemail.com,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	wlanfae@realtek.com,
	linux ARM <linux-arm-kernel@lists.infradead.org>,
	Larry.Finger@lwfinger.net
Subject: Re: [RFC v2 1/1] RTL8712 alignment bug in 3.6 and up on ARMV5
Date: Sat, 15 Dec 2012 22:43:24 +0300	[thread overview]
Message-ID: <20121215194324.GD5032@mwanda> (raw)
In-Reply-To: <CAMW5UfZmptBK5sLq3zMdPJ6C3Arqfyy4SY5BOPfqcOB1T-sbSg@mail.gmail.com>

Thanks for fixing this bug.  Your patch works but it's not the right
way to do it.

The original code here adds 4 to pointers which are currently
aligned instead of leaving them as is.  We have a kernel ALIGN()
macro which works correctly, but actually, it's not needed.

On arm, the pointer returned from kmalloc() is already aligned at
the 8 byte boundary because "#define ARCH_SLAB_MINALIGN 8".  The
original code always adds 4 to the pointer so everything is
misaligned.

Your patch adds another 4 bytes so it is now aligned at the 8 byte
boundary again.  That works, of course, but it's better to remove
the whole mess.

	pstapriv->pallocated_stainfo_buf = kmalloc(sizeof(struct sta_info) * NUM_STA);

Get rid of the ->pstainfo_buf pointer which is only used to store
the "aligned" version of ->pallocated_stainfo_buf.

Please send a version which applies with "git am" and has the proper
sign-off.  Sent it to yourself first.  Save the raw email (including
headers and everything).
	cat raw_email.txt | git am
Type "git log -p" to verify that the commit message looks good.
Then resend it to the list.

Thanks again.  This is a good bugfix.

regards,
dan carpenter


  parent reply	other threads:[~2012-12-15 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 21:38 [RFC v2 1/1] RTL8712 alignment bug in 3.6 and up on ARMV5 Josh Coombs
2012-11-26 21:38 ` Josh Coombs
2012-12-14 20:20 ` Josh Coombs
2012-12-14 20:20   ` Josh Coombs
2012-12-15 19:43 ` Dan Carpenter [this message]
2012-12-15 19:43   ` Dan Carpenter

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=20121215194324.GD5032@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.