kgsl_core_exit() should not call kgsl_sharedmem_uninit_sysfs() and device_unregister() if those resources have not been allocated. We check this by seeing if kgsl_driver.virtdev has been populated or not. CRs-fixed: 359477 Change-Id: Ic040667b29bd4e006e6f29a50809d94a2bb4b469 Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>