Uhm, this case can not happen in this version of the patch. We'll actually fail registering the bus completely with this patch, so there should be no chance that we'll ever go through pci_remove_legacy_files with legacy_io != NULL and legacy_mem == NULL. So no need to NULLify it. But with the change Matthew suggested, we need to pay attention to it. Sorry for the noise here.