The serial port address space ID qualifies the address. Whether a value
of zero for the serial port address can sensibly mean "disabled" depends
on the address space ID. Hence check the address space ID before
checking the address.
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
spcr = container_of(table, struct acpi_table_spcr, header);
+ if ( unlikely(spcr->serial_port.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) )
+ {
+ printk("ns16550: Address space type is not mmio\n");
+ return -EINVAL;
+ }
+
/*
* The serial port address may be 0 for example
* if the console redirection is disabled.
return -EINVAL;
}
- if ( unlikely(spcr->serial_port.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) )
- {
- printk("ns16550: Address space type is not mmio\n");
- return -EINVAL;
- }
-
ns16550_init_common(uart);
/*