From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] [IA64] pci_br: fix a signedness bug
Date: Thu, 04 Aug 2016 05:38:23 +0000 [thread overview]
Message-ID: <20160804053823.GO775@mwanda> (raw)
ate_resource->lowest_free_index is unsigned so it's never less than
zero. I've changed it to test for = -1. This happens when there
aren't any free ates left.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I can't compile this actually...
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_ate.c b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
index 5bc34ea..024ae9b 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_ate.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
@@ -71,7 +71,7 @@ static inline void free_ate_resource(struct ate_resource *ate_resource,
{
mark_ate(ate_resource, start, ate_resource->ate[start], 0);
if ((ate_resource->lowest_free_index > start) ||
- (ate_resource->lowest_free_index < 0))
+ (ate_resource->lowest_free_index = -1))
ate_resource->lowest_free_index = start;
}
@@ -86,7 +86,7 @@ static inline int alloc_ate_resource(struct ate_resource *ate_resource,
/*
* Check for ate exhaustion.
*/
- if (ate_resource->lowest_free_index < 0)
+ if (ate_resource->lowest_free_index = -1)
return -1;
/*
reply other threads:[~2016-08-04 5:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20160804053823.GO775@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@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).