1
0
Fork 0

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>
hifive-unleashed-5.1
zhong jiang 2018-09-16 21:45:02 +08:00 committed by David S. Miller
parent 1ddc5d3e5f
commit b458925ed5
1 changed files with 1 additions and 2 deletions

View File

@ -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);
}