Patchwork netxen_nic: signedness bug in netxen_md_entry_err_chk()

login
register
mail settings
Submitter Dan Carpenter
Date Feb. 8, 2012, 9:23 a.m.
Message ID <20120208092335.GC6554@elgon.mountain>
Download mbox | patch
Permalink /patch/140077/
State Accepted
Delegated to: David Miller
Headers show

Comments

Dan Carpenter - Feb. 8, 2012, 9:23 a.m.
"esize" should be signed because it can be negative here.  For example,
when we call it in netxen_parse_md_template(), it could be -1 from the
return value of netxen_md_L2Cache().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Feb. 9, 2012, 1:28 a.m.
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 8 Feb 2012 12:23:36 +0300

> "esize" should be signed because it can be negative here.  For example,
> when we call it in netxen_parse_md_template(), it could be -1 from the
> return value of netxen_md_L2Cache().
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
index 0a81228..6f37470 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
@@ -2354,7 +2354,7 @@  netxen_md_rdqueue(struct netxen_adapter *adapter,
 */
 
 static int netxen_md_entry_err_chk(struct netxen_adapter *adapter,
-				struct netxen_minidump_entry *entry, u32 esize)
+				struct netxen_minidump_entry *entry, int esize)
 {
 	if (esize < 0) {
 		entry->hdr.driver_flags |= NX_DUMP_SKIP;