public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Jiri Kosina <jkosina@suse.cz>,
	Lucas De Marchi <lucas.demarchi@profusion.mobi>,
	linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ipw2x00: signedness bug handling frame length
Date: Fri, 13 Jan 2012 10:36:24 +0000	[thread overview]
Message-ID: <20120113103624.GK16258@mwanda> (raw)
In-Reply-To: <20120113102908.GB2214@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]

On Fri, Jan 13, 2012 at 11:29:09AM +0100, Stanislaw Gruszka wrote:
> On Thu, Jan 12, 2012 at 09:34:50AM +0300, Dan Carpenter wrote:
> > This is basically just a cleanup.  Large positive numbers get counted as
> > negative but then get implicitly cast to positive again for the checks
> > that matter.
> > 
> > This does make a small difference in ipw_handle_promiscuous_rx() when we
> > test "if (unlikely((len + IPW_RX_FRAME_SIZE) > skb_tailroom(rxb->skb)))"
> > It should return there, but we don't return until a couple lines later
> > when we test "if (len > IPW_RX_BUF_SIZE - sizeof(struct ipw_rt_hdr)) {".
> > The difference is that in the second test the sizeof() means that there
> > is an implied cast to unsigned.
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Not sure if making it "unsinged int" would be better, but this change is
> fine to me as is too.

Yeah.  You're probably right...  Next time, I'll do it that way.  ;)

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2012-01-13 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12  6:34 [patch] ipw2x00: signedness bug handling frame length Dan Carpenter
2012-01-13 10:29 ` Stanislaw Gruszka
2012-01-13 10:36   ` Dan Carpenter [this message]

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=20120113103624.GK16258@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jkosina@suse.cz \
    --cc=johannes.berg@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=sgruszka@redhat.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