From: 黄涛 Date: Wed, 14 Dec 2011 07:16:05 +0000 (+0800) Subject: rk29: vpu_mem: fix pass miscdevice pointer via file private data X-Git-Tag: firefly_0821_release~9712^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=006a102f054da14af6c43f27fba3f5caa4f38576;p=firefly-linux-kernel-4.4.55.git rk29: vpu_mem: fix pass miscdevice pointer via file private data --- diff --git a/arch/arm/mach-rk29/vpu_mem.c b/arch/arm/mach-rk29/vpu_mem.c index 58accfd8ef56..bc05e6842ea4 100644 --- a/arch/arm/mach-rk29/vpu_mem.c +++ b/arch/arm/mach-rk29/vpu_mem.c @@ -878,7 +878,7 @@ static int vpu_mem_open(struct inode *inode, struct file *file) DLOG("current %u file %p(%d)\n", current->pid, file, (int)file_count(file)); /* setup file->private_data to indicate its unmapped */ /* you can only open a vpu_mem device one time */ - if (file->private_data != NULL) + if (file->private_data != NULL && file->private_data != &vpu_mem.dev) return -1; session = kmalloc(sizeof(vdm_session), GFP_KERNEL); if (!session) {