Haiyang Zhang
2011-Jul-26 19:15 UTC
[PATCH] staging: hv: fix a memory leak in adj_guesttime()
The allocated struct adj_time_work needs to be freed if we are not using it. Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com> Signed-off-by: K. Y. Srinivasan <kys at microsoft.com> --- drivers/staging/hv/hv_util.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c index d3fb017..4fc1c98 100644 --- a/drivers/staging/hv/hv_util.c +++ b/drivers/staging/hv/hv_util.c @@ -157,7 +157,10 @@ static inline void adj_guesttime(u64 hosttime, u8 flags) scnt--; INIT_WORK(&wrk->work, hv_set_host_time); schedule_work(&wrk->work); + return; } + + kfree(wrk); } /* -- 1.6.3.2