public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] unlock_kernel() on error path in sx_fw_ioctl()
@ 2009-02-03  8:14 Dan Carpenter
  2009-02-04  4:58 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2009-02-03  8:14 UTC (permalink / raw)
  To: R.E.Wolff; +Cc: linux-kernel

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@gmail.com>

--- 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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-04  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03  8:14 [patch] unlock_kernel() on error path in sx_fw_ioctl() Dan Carpenter
2009-02-04  4:58 ` Andrew Morton
2009-02-04  9:49   ` Rogier Wolff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox