Commit d329e41a authored by Vinicius Costa Gomes's avatar Vinicius Costa Gomes Committed by David S. Miller

ptp: Fix possible memory leak caused by invalid cast

Fixes possible leak of PTP virtual clocks.

The number of PTP virtual clocks to be unregistered is passed as
'u32', but the function that unregister the devices handles that as
'u8'.

Fixes: 73f37068 ("ptp: support ptp physical/virtual clocks conversion")
Signed-off-by: default avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2383cb94
...@@ -154,7 +154,7 @@ static int unregister_vclock(struct device *dev, void *data) ...@@ -154,7 +154,7 @@ static int unregister_vclock(struct device *dev, void *data)
struct ptp_clock *ptp = dev_get_drvdata(dev); struct ptp_clock *ptp = dev_get_drvdata(dev);
struct ptp_clock_info *info = ptp->info; struct ptp_clock_info *info = ptp->info;
struct ptp_vclock *vclock; struct ptp_vclock *vclock;
u8 *num = data; u32 *num = data;
vclock = info_to_vclock(info); vclock = info_to_vclock(info);
dev_info(dev->parent, "delete virtual clock ptp%d\n", dev_info(dev->parent, "delete virtual clock ptp%d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment