All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Joe Perches <joe@perches.com>
Cc: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>,
	Ron Mercer <ron.mercer@qlogic.com>,
	linux-driver@qlogic.com, netdev <netdev@vger.kernel.org>
Subject: Re: qla3xxx: Odd likely incorrect use of test_bit in qla3xxx.c
Date: Wed, 13 May 2015 16:19:08 +0300	[thread overview]
Message-ID: <20150513131908.GB8431@mwanda> (raw)
In-Reply-To: <1431456145.2884.75.camel@perches.com>

Good eye, Joe.

I wrote a Smatch check to find similar bugs.  They weren't any other
places which tried to do bitwise OR.  The bug that happens occasionally
is:

#define MY_FLAG BIT(1)

	if (test_bit(MY_FLAG, &map)) {
		...

It's not normally harmful if it's used consistently, but ath9k had
memory corruption because they do:

	set_bit(BIT(6), &some_unsigned_long);

Anyway, I'll send patches for the bugs I found and push the Smatch
check. Thanks!

regards,
dan carpenter

  reply	other threads:[~2015-05-13 13:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 18:42 qla3xxx: Odd likely incorrect use of test_bit in qla3xxx.c Joe Perches
2015-05-13 13:19 ` Dan Carpenter [this message]
2015-05-13 16:08   ` Joe Perches
2015-05-13 17:34   ` Joe Perches
2015-05-14  8:01     ` Dan Carpenter
2015-05-14  8:22       ` Joe Perches

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=20150513131908.GB8431@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jitendra.kalsaria@qlogic.com \
    --cc=joe@perches.com \
    --cc=linux-driver@qlogic.com \
    --cc=netdev@vger.kernel.org \
    --cc=ron.mercer@qlogic.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.