diff options
author | 2018-09-16 21:45:02 +0800 | |
---|---|---|
committer | 2018-09-17 08:20:11 -0700 | |
commit | b458925ed5797a20f22cdf005625e25106cf7124 (patch) | |
tree | e0e767319c6f70772521398dac38a0aa3aaf6464 /net/dsa | |
parent | net: dsa: remove redundant null pointer check before of_node_put (diff) | |
download | linux-b458925ed5797a20f22cdf005625e25106cf7124.tar.gz linux-b458925ed5797a20f22cdf005625e25106cf7124.tar.bz2 linux-b458925ed5797a20f22cdf005625e25106cf7124.zip |
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 <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/legacy.c | 3 |
1 files changed, 1 insertions, 2 deletions
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); } |