Skip to contentSkip to conversation

ARM: v3.4-rc1 amba-pl011 regression (NULL pointer dereference)

PATCH Frank Rowand 1 participant 1 message Apr 11, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

linux-kernel was left off the original message, resending.

commit 9b96fbac introduced use of pointer before it is initialized, resulting in a NULL pointer dereference on boot for the ARM Realview.

uap->port.membase is initialized to base a few lines later, so just use base.

---
drivers/tty/serial/amba-pl011.c | 4 2 + 2 - 0 !

 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/amba-pl011.c +2 -2
Index: b/drivers/tty/serial/amba-pl011.c
===================================================================
@@ -1947,8 +1947,8 @@ static int pl011_probe(struct amba_devic
 	}
 
 	/* Ensure interrupts from this UART are masked and cleared */
-	writew(0, uap->port.membase + UART011_IMSC);
-	writew(0xffff, uap->port.membase + UART011_ICR);
+	writew(0, base + UART011_IMSC);
+	writew(0xffff, base + UART011_ICR);
 
 	uap->vendor = vendor;
 	uap->lcrh_rx = vendor->lcrh_rx;