We can do this, @@ -585,6 +595,13 @@ void uacce_remove(struct uacce_device *uacce)Should we unmap them at the first of 'uacce_remove', and before 'uacce_put_queue'?
ÂÂÂÂÂÂÂÂÂ cdev_device_del(uacce->cdev, &uacce->dev);
ÂÂÂÂÂ xa_erase(&uacce_xa, uacce->dev_id);
ÂÂÂÂÂ put_device(&uacce->dev);
+
+ÂÂÂ /*
+ÂÂÂÂ * unmap remainning mapping from user space, preventing user still
+ÂÂÂÂ * access the mmaped area while parent device is already removed
+ÂÂÂÂ */
+ÂÂÂ if (uacce->inode)
+ÂÂÂÂÂÂÂ unmap_mapping_range(uacce->inode->i_mapping, 0, 0, 1);