net: sun: sungem: rix a possible null dereference
Subsystems (2)
PATCH 1/1 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.
This issue was added by the patch 92552fdd557:
"net: sun: sungem: use new api ethtool_{get|set}_link_ksettings".
--- drivers/net/ethernet/sun/sungem.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/sun/sungem.c +3 -2
@@ -1259,8 +1259,9 @@ static void gem_begin_auto_negotiation(struct gem *gp,int duplex;u32 advertising; -ethtool_convert_link_mode_to_legacy_u32 (&advertising, - ep->link_modes.advertising); +if (ep) +ethtool_convert_link_mode_to_legacy_u32 ( + &advertising, ep->link_modes.advertising);if (gp->phy_type != phy_mii_mdio0 && gp->phy_type != phy_mii_mdio1)
Signature · 1 line
1.7.4.4
Hello!
Quoted 6 lines · Philippe Reynes
The function
gem_begin_auto_negotiationdereference the pointer ep before testing if it's null. This patch add a check on ep before dereferencing it.This issue was added by the patch
92552fdd557:
"net: sun: sungem: use new api ethtool_{get|set}_link_ksettings".
There's Fixes: tag for that now, described inDocumentation/process/submitting-patches.rst...
Quoted 2 lines
Reported-by Dan Carpenter <[email protected]>Signed-off-by Philippe Reynes <[email protected]>
[...]
MBR, Sergei
Hi Sergei,
Quoted 8 lines · Sergei Shtylyov
Hello!
Quoted 4 lines · Philippe Reynes
The function
gem_begin_auto_negotiationdereference the pointer ep before testing if it's null. This patch add a check on ep before dereferencing it.
Quoted 5 lines
Quoted 2 lines
This issue was added by the patch
92552fdd557:
"net: sun: sungem: use new api ethtool_{get|set}_link_ksettings".There's Fixes: tag for that now, described in
Documentation/process/submitting-patches.rst...
Thanks a lot for pointing me this tag.
I'm sending a v2 of this patch with this tag.
Quoted 6 lines
Quoted 2 lines
Reported-by Dan Carpenter <[email protected]>Signed-off-by Philippe Reynes <[email protected]>[...]
MBR, Sergei
Thanks,
Philippe