Skip to contentSkip to conversation

Char: stallion, fix oops during init with ISA cards

PATCH New Ingo Korb 2 participants 2 messages Jun 15, 2007 Char and misc drivers

lore
Share & tools
lore

Ingo Korb

author
#0 lore raw

PATCH 1/1 Char: stallion, fix oops during init with ISA cards

The stallion driver oopses while initializing ISA cards due to an uninitialized variable. This patch changes the initialisation order to match the PCI code path.

---

drivers/char/stallion.c +4 -3
index 45bf2a2..8c73ccb 100644
@@ -4753,13 +4753,14 @@ static int __init stallion_module_init(void)
 		brdp->ioaddr2 = conf.ioaddr2;
 		brdp->irq = conf.irq;
 		brdp->irqtype = conf.irqtype;
-		if (stl_brdinit(brdp))
+		stl_brds[brdp->brdnr] = brdp;
+		if (stl_brdinit(brdp)) {
+			stl_brds[brdp->brdnr] = NULL;
 			kfree(brdp);
-		else {
+		} else {
 			for (j = 0; j < brdp->nrports; j++)
 				tty_register_device(stl_serial,
 					brdp->brdnr * STL_MAXPORTS + j, NULL);
-			stl_brds[brdp->brdnr] = brdp;
 			stl_nrbrds = i + 1;
 		}
 	}
#1 lore raw

PATCH 1/1 Char: stallion, fix oops during init with ISA cards

Thanks, seems good to me. Next time, feel free Cc Andrew directly.

--

From: Ingo Korb <[email protected]>

stallion, fix oops during init with ISA cards

The stallion driver oopses while initializing ISA cards due to an uninitialized variable. This patch changes the initialisation order to match the PCI code path.

---

drivers/char/stallion.c +4 -3
index 45bf2a2..8c73ccb 100644
@@ -4753,13 +4753,14 @@ static int __init stallion_module_init(void)
 		brdp->ioaddr2 = conf.ioaddr2;
 		brdp->irq = conf.irq;
 		brdp->irqtype = conf.irqtype;
-		if (stl_brdinit(brdp))
+		stl_brds[brdp->brdnr] = brdp;
+		if (stl_brdinit(brdp)) {
+			stl_brds[brdp->brdnr] = NULL;
 			kfree(brdp);
-		else {
+		} else {
 			for (j = 0; j < brdp->nrports; j++)
 				tty_register_device(stl_serial,
 					brdp->brdnr * STL_MAXPORTS + j, NULL);
-			stl_brds[brdp->brdnr] = brdp;
 			stl_nrbrds = i + 1;
 		}
 	}