diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-21 19:36:23 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-21 19:36:23 (GMT) |
commit | 868f480bed5266347b168c2bbe7b010cf9cac1dd (patch) | |
tree | 9a43f48568521eda7af3f2e559846402f205f7ec | |
parent | 6d77987fe62eb97479f27426d12f33ef97145c5b (diff) | |
parent | b232a70a1735c004f9ee6fdf363def527b9234b6 (diff) | |
download | linux-868f480bed5266347b168c2bbe7b010cf9cac1dd.tar.xz |
Merge git://www.linux-watchdog.org/linux-watchdog
Pull watchdog fixes from Wim Van Sebroeck:
"Fix a kdump issue in hpwdt and a possible NULL dereference."
* git://www.linux-watchdog.org/linux-watchdog:
watchdog: move the dereference below the NULL test
hpwdt: Fix kdump issue in hpwdt
-rw-r--r-- | drivers/watchdog/hpwdt.c | 3 | ||||
-rw-r--r-- | drivers/watchdog/watchdog_core.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 1eff743..ae60406 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -814,6 +814,9 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev, hpwdt_timer_reg = pci_mem_addr + 0x70; hpwdt_timer_con = pci_mem_addr + 0x72; + /* Make sure that timer is disabled until /dev/watchdog is opened */ + hpwdt_stop(); + /* Make sure that we have a valid soft_margin */ if (hpwdt_change_timer(soft_margin)) hpwdt_change_timer(DEFAULT_MARGIN); diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index 6aa46a9..3796434 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c @@ -128,11 +128,12 @@ EXPORT_SYMBOL_GPL(watchdog_register_device); void watchdog_unregister_device(struct watchdog_device *wdd) { int ret; - int devno = wdd->cdev.dev; + int devno; if (wdd == NULL) return; + devno = wdd->cdev.dev; ret = watchdog_dev_unregister(wdd); if (ret) pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); |