]> git.baikalelectronics.ru Git - kernel.git/commit
net: mdio: of: fix potential NULL pointer derefernce
authorMichael Walle <michael@walle.cc>
Thu, 30 Jan 2020 17:44:50 +0000 (18:44 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 31 Jan 2020 15:46:11 +0000 (07:46 -0800)
commit5e44366033acefb6813e3002faab25cd5b9d8c2f
treeeb25c5a6b7e4105c3ff95af5d584b189d6697d0d
parente2a81d318f425442f48e2c6ee93dbd575ef62cca
net: mdio: of: fix potential NULL pointer derefernce

of_find_mii_timestamper() returns NULL if no timestamper is found.
Therefore, guard the unregister_mii_timestamper() calls.

Fixes: 73cfdf667885 ("net: mdio: of: Register discovered MII time stampers.")
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/of/of_mdio.c