vioser: fix possible NULL 'port' pointer dereference (SDV)
VIOSerialFindPortById may produce NULL 'port' pointer,
VIOSerialInitPortConsole may consume it and perform pointer
dereference.
@@ -152,7 +152,7 @@ VIOSerialHandleCtrlMsg(
case VIRTIO_CONSOLE_CONSOLE_PORT:
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,
"VIRTIO_CONSOLE_CONSOLE_PORT id = %d value = %u\n", cpkt->id, cpkt->value);
- if (cpkt->value)
+ if (port && cpkt->value)
{
VIOSerialInitPortConsole(Device,port);
}
