mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
pmem: fix pass miscdevice pointer via file private data
This commit is contained in:
@@ -337,7 +337,7 @@ static int pmem_open(struct inode *inode, struct file *file)
|
||||
DLOG("current %u file %p(%d)\n", current->pid, file, file_count(file));
|
||||
/* setup file->private_data to indicate its unmapped */
|
||||
/* you can only open a pmem device one time */
|
||||
if (file->private_data != NULL)
|
||||
if (file->private_data != NULL && file->private_data != &pmem[id].dev)
|
||||
return -1;
|
||||
data = kmalloc(sizeof(struct pmem_data), GFP_KERNEL);
|
||||
if (!data) {
|
||||
|
||||
Reference in New Issue
Block a user