net: sun: sungem: rix a possible null dereference
authorPhilippe Reynes <tremyfr@gmail.com>
Fri, 17 Mar 2017 21:54:04 +0000 (22:54 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Mar 2017 00:44:46 +0000 (17:44 -0700)
commite74bad6b015b732d8269a8ddfb303c9b33092722
tree1d6d998d4cf73245d459d9098323bfa106c5262a
parentc5b71e633da381c299990341ec88694bd00ecad1
net: sun: sungem: rix a possible null dereference

The function gem_begin_auto_negotiation dereference
the pointer ep before testing if it's null. This
patch add a check on ep before dereferencing it.

Fixes: 92552fdda557 ("net: sun: sungem: use new api
ethtool_{get|set}_link_ksettings")

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/sungem.c