X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=arch%2Fmips%2Fkernel%2Fvpe.c;h=a1b3da6bad5cb17c577712ac4bf83f439b5d7292;hb=8ebcfc8bcb55261cf01fc302d707fbba46242bf1;hp=2794501ff302923b38afe00c3e90531379307bf2;hpb=a177ba3b7a08beef3f0fe74efa0f90701891945a;p=linux-2.6-omap-h63xx.git diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 2794501ff30..a1b3da6bad5 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -1050,17 +1051,20 @@ static int vpe_open(struct inode *inode, struct file *filp) enum vpe_state state; struct vpe_notifications *not; struct vpe *v; - int ret; + int ret, err = 0; + lock_kernel(); if (minor != iminor(inode)) { /* assume only 1 device at the moment. */ printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); - return -ENODEV; + err = -ENODEV; + goto out; } if ((v = get_vpe(tclimit)) == NULL) { printk(KERN_WARNING "VPE loader: unable to get vpe\n"); - return -ENODEV; + err = -ENODEV; + goto out; } state = xchg(&v->state, VPE_STATE_INUSE); @@ -1100,6 +1104,8 @@ static int vpe_open(struct inode *inode, struct file *filp) v->shared_ptr = NULL; v->__start = 0; +out: + unlock_kernel(); return 0; } @@ -1128,7 +1134,7 @@ static int vpe_release(struct inode *inode, struct file *filp) /* It's good to be able to run the SP and if it chokes have a look at the /dev/rt?. But if we reset the pointer to the shared struct we - loose what has happened. So perhaps if garbage is sent to the vpe + lose what has happened. So perhaps if garbage is sent to the vpe device, use it as a trigger for the reset. Hopefully a nice executable will be along shortly. */ if (ret < 0)