crypto: ccp - Release locks before returning
authorGary R Hook <gary.hook@amd.com>
Mon, 19 Jun 2017 17:31:17 +0000 (12:31 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 22 Jun 2017 08:54:09 +0000 (16:54 +0800)
krobot warning: make sure that all error return paths release locks.

Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-debugfs.c

index 6d86693b117fd2c00cbe6ef11bf50feb1ba79b57..3cd6c83754e0870e8fcd2f7eaea56b67ca90a921 100644 (file)
@@ -297,12 +297,11 @@ void ccp5_debugfs_setup(struct ccp_device *ccp)
                return;
 
        write_lock_irqsave(&ccp_debugfs_lock, flags);
-       if (!ccp_debugfs_dir) {
+       if (!ccp_debugfs_dir)
                ccp_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
-               if (!ccp_debugfs_dir)
-                       return;
-       }
        write_unlock_irqrestore(&ccp_debugfs_lock, flags);
+       if (!ccp_debugfs_dir)
+               return;
 
        ccp->debugfs_instance = debugfs_create_dir(ccp->name, ccp_debugfs_dir);
        if (!ccp->debugfs_instance)