* [bug report] net: phylink: add suspend/resume support
@ 2021-09-09 9:05 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-09-09 9:05 UTC (permalink / raw)
To: rmk+kernel; +Cc: kernel-janitors
Hello Russell King (Oracle),
This is a semi-automatic email about new static checker warnings.
The patch f97493657c63: "net: phylink: add suspend/resume support"
from Sep 7, 2021, leads to the following Smatch complaint:
drivers/net/phy/phylink.c:1336 phylink_suspend()
error: we previously assumed 'pl->netdev' could be null (see line 1325)
drivers/net/phy/phylink.c
1324
1325 if (mac_wol && (!pl->netdev || pl->netdev->wol_enabled)) {
^^^^^^^^^^
This checks for NULL
1326 /* Wake-on-Lan enabled, MAC handling */
1327 mutex_lock(&pl->state_mutex);
1328
1329 /* Stop the resolver bringing the link up */
1330 __set_bit(PHYLINK_DISABLE_MAC_WOL, &pl->phylink_disable_state);
1331
1332 /* Disable the carrier, to prevent transmit timeouts,
1333 * but one would hope all packets have been sent. This
1334 * also means phylink_resolve() will do nothing.
1335 */
1336 netif_carrier_off(pl->netdev);
^^^^^^^^^^
But there is an unchecked dereference inside the netif_carrier_off()
function.
1337
1338 /* We do not call mac_link_down() here as we want the
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-09 9:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 9:05 [bug report] net: phylink: add suspend/resume support Dan Carpenter
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).