summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-09-21 12:36:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-09-21 12:36:23 -0700
commit868f480bed5266347b168c2bbe7b010cf9cac1dd (patch)
tree9a43f48568521eda7af3f2e559846402f205f7ec /drivers
parent6d77987fe62eb97479f27426d12f33ef97145c5b (diff)
parentb232a70a1735c004f9ee6fdf363def527b9234b6 (diff)
downloadlinux-3.10-868f480bed5266347b168c2bbe7b010cf9cac1dd.tar.gz
linux-3.10-868f480bed5266347b168c2bbe7b010cf9cac1dd.tar.bz2
linux-3.10-868f480bed5266347b168c2bbe7b010cf9cac1dd.zip
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
Diffstat (limited to 'drivers')
-rw-r--r--drivers/watchdog/hpwdt.c3
-rw-r--r--drivers/watchdog/watchdog_core.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 1eff743ec49..ae60406ea8a 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 6aa46a90ff0..3796434991f 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);