From: zhong jiang Date: Sun, 16 Sep 2018 13:45:02 +0000 (+0800) Subject: net: dsa: remove redundant null pointer check before put_device X-Git-Tag: for-linus-20181026~43^2~374 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=b458925ed5797a20f22cdf005625e25106cf7124;p=linux-2.6-block.git net: dsa: remove redundant null pointer check before put_device put_device has taken the null pinter check into account. So it is safe to remove the duplicated check before put_device. Signed-off-by: zhong jiang Signed-off-by: David S. Miller --- diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c index 42a7b85b84e1..8aa92b09db76 100644 --- a/net/dsa/legacy.c +++ b/net/dsa/legacy.c @@ -392,8 +392,7 @@ static void dsa_of_free_platform_data(struct dsa_platform_data *pd) } /* Drop our reference to the MDIO bus device */ - if (pd->chip[i].host_dev) - put_device(pd->chip[i].host_dev); + put_device(pd->chip[i].host_dev); } kfree(pd->chip); }