Messages in this thread | | | Date | Sun, 8 Jan 2012 22:23:16 +0100 (CET) | From | Jesper Juhl <> | Subject | Intel ixgbe: uninitialized variable use in ixgbe_non_sfp_link_config() |
| |
Hi (sorry about the duplicate, I messed up the LKML addr. on the first mail)
In ixgbe_non_sfp_link_config(), the variable 'negotiation' is declared without initializer and unless we take the true branch in the 'if ((!autoneg) && (hw->mac.ops.get_link_capabilities))' statement it will remain uninitialized when it is subsequently read in the 'ret = hw->mac.ops.setup_link(hw, autoneg, negotiation, link_up)' statement.
The test of 'ret' after the 'if ((!autoneg) && (hw->mac.ops.get_link_capabilities))' statement also looks fairly pointless if we do not take the true branch, since then 'ret' will not have been changed since the previous identical test.
The correct fix escapes me since I don't really know this code (and don't plan to spend the time to get to know it), but I thought I'd just report what I had noticed and then someone else can hopefully come up with a good fix :-)
PS. Please CC me on replies.
-- Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/ Don't top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, please.
| |