Staging: ced1401: fix missing unlock on error in FreeCircBlock()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 22 Oct 2012 05:22:15 +0000 (13:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Oct 2012 20:28:43 +0000 (13:28 -0700)
Add the missing unlock on the error handle path in function
FreeCircBlock().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ced1401/ced_ioc.c

index c9492edaaddb97ffb06ba796e0079f265549d6d7..5813aee6b34899302a7347caa1cef7642ff45276 100644 (file)
@@ -1508,7 +1508,7 @@ int FreeCircBlock(DEVICE_EXTENSION * pdx, TCIRCBLOCK __user * pCB)
                iReturn = U14ERR_BADAREA;
 
        if (copy_to_user(pCB, &cb, sizeof(cb)))
-               return -EFAULT;
+               iReturn = -EFAULT;
 
        mutex_unlock(&pdx->io_mutex);
        return iReturn;