[16/99] watchdog: Fix rio watchdog probe function

From: Greg KH
Date: Fri Nov 06 2009 - 17:45:59 EST

2.6.31-stable review patch. If anyone has any objections, please let us know.

From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

[ Upstream commit 03717e3d12b625268848414e39beda25e4515692 ]

After sucessfully registering the misc device the driver iounmaps the
hardware registers and kfree's the device data structure. Ouch !

This was introduced with commit e42311d75 (riowatchdog: Convert to
pure OF driver) and went unnoticed for more than a year :)

Return success instead of dropping into the error cleanup code path.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

drivers/watchdog/riowd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/watchdog/riowd.c
+++ b/drivers/watchdog/riowd.c
@@ -206,7 +206,7 @@ static int __devinit riowd_probe(struct

dev_set_drvdata(&op->dev, p);
riowd_device = p;
- err = 0;
+ return 0;

of_iounmap(&op->resource[0], p->regs, 2);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/