OSDN Git Service

net: atlantic: possible fault in transition to hibernation
authorPavel Belous <pbelous@marvell.com>
Fri, 14 Feb 2020 15:44:57 +0000 (18:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Feb 2020 03:03:40 +0000 (19:03 -0800)
commit52a22f4d6ff95e8bdca557765c04893eb5dd83fd
treecc209332ae6a6d360e4daf263e06abca0487bbfc
parent380ec5b9af7f0d57dbf6ac067fd9f33cff2fef71
net: atlantic: possible fault in transition to hibernation

during hibernation freeze, aq_nic_stop could be invoked
on a stopped device. That may cause panic on access to
not yet allocated vector/ring structures.

Add a check to stop device if it is not yet stopped.

Similiarly after freeze in hibernation thaw, aq_nic_start
could be invoked on a not initialized net device.
Result will be the same.

Add a check to start device if it is initialized.
In our case, this is the same as started.

Fixes: 8aaa112a57c1 ("net: atlantic: refactoring pm logic")
Signed-off-by: Pavel Belous <pbelous@marvell.com>
Signed-off-by: Nikita Danilov <ndanilov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c