[PATCH] Drivers: hv: util: don't forget to init host_ts.lock
From: Dexuan Cui
Date: Wed Feb 15 2017 - 09:07:47 EST
Without the patch, I always get a "BUG: spinlock bad magic" warning.
Fixes: 3716a49a81ba ("hv_utils: implement Hyper-V PTP source")
Signed-off-by: Dexuan Cui <decui@xxxxxxxxxxxxx>
Cc: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
Cc: "K. Y. Srinivasan" <kys@xxxxxxxxxxxxx>
Cc: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
Cc: Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>
---
3716a49a81ba is the commit id in char-misc.git, since the patch hasn't
been in Linus's tree yet.
drivers/hv/hv_util.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index 098cd3d..60d763c 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -591,6 +591,8 @@ static int hv_timesync_init(struct hv_util_service *srv)
if (!hyperv_cs)
return -ENODEV;
+ spin_lock_init(&host_ts.lock);
+
INIT_WORK(&wrk.work, hv_set_host_time);
/*
--
2.7.4