* re: team: add broadcast mode
@ 2012-11-20 19:23 Dan Carpenter
2012-11-21 9:36 ` Jiri Pirko
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-11-20 19:23 UTC (permalink / raw)
To: jpirko; +Cc: netdev
Hello Jiri Pirko,
The patch 5fc889911a99: "team: add broadcast mode" from Jul 11, 2012,
leads to the following Smatch warning:
drivers/net/team/team_mode_broadcast.c:46 bc_transmit()
warn: signedness bug returning '18446744073709551516'
The error message sucks because 18446744073709551516 is -100 as an int,
and I'm not sure how it figures this returns -100...
But actually there is a signedness bug in bc_transmit(). We return
error codes from team_dev_queue_xmit() and cast them to 1 as bool. This
function is supposed to return 1 on success but instead it returns zero.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: team: add broadcast mode
2012-11-20 19:23 team: add broadcast mode Dan Carpenter
@ 2012-11-21 9:36 ` Jiri Pirko
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Pirko @ 2012-11-21 9:36 UTC (permalink / raw)
To: Dan Carpenter; +Cc: jpirko, netdev
Tue, Nov 20, 2012 at 08:23:07PM CET, dan.carpenter@oracle.com wrote:
>Hello Jiri Pirko,
>
>The patch 5fc889911a99: "team: add broadcast mode" from Jul 11, 2012,
>leads to the following Smatch warning:
>drivers/net/team/team_mode_broadcast.c:46 bc_transmit()
> warn: signedness bug returning '18446744073709551516'
>
>The error message sucks because 18446744073709551516 is -100 as an int,
>and I'm not sure how it figures this returns -100...
>
>But actually there is a signedness bug in bc_transmit(). We return
>error codes from team_dev_queue_xmit() and cast them to 1 as bool. This
>function is supposed to return 1 on success but instead it returns zero.
Thanks Dan for finding this. You are correct.
I'm going to send patch introducing "!" in front of both
team_dev_queue_xmit() calls in bc_transmit(). That will correct this.
Jiri
>
>regards,
>dan carpenter
>
>--
>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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-21 9:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-20 19:23 team: add broadcast mode Dan Carpenter
2012-11-21 9:36 ` Jiri Pirko
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).