[patch] unlock_kernel() on error path in sx_fw_ioctl()

From: Dan Carpenter
Date: Tue Feb 03 2009 - 03:14:53 EST


If we return directly with -EPERM then lock_kernel() is still held.

This was found with a code checker (http://repo.or.cz/w/smatch.git/). Compile tested only, sorry.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>

--- orig/drivers/char/sx.c 2009-02-03 08:27:59.000000000 +0300
+++ devel/drivers/char/sx.c 2009-02-03 08:28:31.000000000 +0300
@@ -1747,7 +1747,8 @@
break;
case SXIO_DO_RAMTEST:
if (sx_initialized) /* Already initialized: better not ramtest the board. */
- return -EPERM;
+ rc = -EPERM;
+ break;
if (IS_SX_BOARD(board)) {
rc = do_memtest(board, 0, 0x7000);
if (!rc)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/