login
Header Space

 
 

[PATCH 3/4] Char: ip2, fix sparse warnings

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <linux-kernel@...>, Jiri Slaby <jirislaby@...>
Date: Friday, March 28, 2008 - 5:18 pm

Unlock two grabbed locks on some paths.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/char/ip2/i2lib.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/char/ip2/i2lib.c b/drivers/char/ip2/i2lib.c
index 618f5fe..1d5388c 100644
--- a/drivers/char/ip2/i2lib.c
+++ b/drivers/char/ip2/i2lib.c
@@ -643,12 +643,12 @@ i2QueueCommands(int type, i2ChanStrPtr pCh, int timeout, int nCommands,
 				// Normal Expected path - We still hold LOCK
 				break; /* from for()- Enough room: goto proceed */
 			}
-		}
-
-		ip2trace (CHANN, ITRC_QUEUE, 3, 1, totalsize );
+			ip2trace(CHANN, ITRC_QUEUE, 3, 1, totalsize);
+			write_unlock_irqrestore(lock_var_p, flags);
+		} else
+			ip2trace(CHANN, ITRC_QUEUE, 3, 1, totalsize);
 
 		// Prepare to wait for buffers to empty
-		write_unlock_irqrestore(lock_var_p, flags);
 		serviceOutgoingFifo(pB);	// Dump what we got
 
 		if (timeout == 0) {
@@ -1834,6 +1834,8 @@ i2StripFifo(i2eBordStrPtr pB)
 		default: // Neither packet? should be impossible
 			ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 5, 1,
 				PTYPE_OF(pB->i2eLeadoffWord) );
+			write_unlock_irqrestore(&pB->read_fifo_spinlock,
+					bflags);
 
 			break;
 		}  // End of switch on type of packets
-- 
1.5.4.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/4] Char: ip2, fix sparse warnings, Jiri Slaby, (Fri Mar 28, 5:18 pm)
Re: [PATCH 3/4] Char: ip2, fix sparse warnings, Andrew Morton, (Mon Mar 31, 7:57 pm)
Re: [PATCH 3/4] Char: ip2, fix sparse warnings, Jiri Slaby, (Tue Apr 1, 5:53 am)
speck-geostationary