Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
torvalds committed Sep 21, 2012
2 parents 6d77987 + b232a70 commit 868f480
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/watchdog/hpwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion drivers/watchdog/watchdog_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 868f480

Please sign in to comment.