Skip to contentSkip to conversation

drop chan->wsem on error path

PATCH In review Dan Carpenter 3 participants 3 messages Nov 29, 2009 – Nov 30, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drop chan->wsem on error path

The other paths all drop chan->wsem. This was found by a static checker (smatch).

drivers/net/wan/cosa.c +1 -0
@@ -907,6 +907,7 @@ static ssize_t cosa_write(struct file *f
 			current->state = TASK_RUNNING;
 			chan->tx_status = 1;
 			spin_unlock_irqrestore(&cosa->lock, flags);
+			up(&chan->wsem);
 			return -ERESTARTSYS;
 		}
 	}
Acked-by on v1 1/1
#1 lore raw

Dan Carpenter wrote:
: The other paths all drop chan->wsem. This was found by a static : checker (smatch).

You are right, thanks!

:
: Signed-off-by: Dan Carpenter <[email protected]>

: --- orig/drivers/net/wan/cosa.c 2009-11-29 16:38:42.000000000 +0200
: +++ devel/drivers/net/wan/cosa.c 2009-11-29 16:43:39.000000000 +0200
: @@ -907,6 +907,7 @@ static ssize_t cosa_write(struct file *f

:  			current->state = TASK_RUNNING;
:  			chan->tx_status = 1;
:  			spin_unlock_irqrestore(&cosa->lock, flags);
: +			up(&chan->wsem);
:  			return -ERESTARTSYS;
:  		}
:  	}
Signature · 5 lines
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/    Journal: http://www.fi.muni.cz/~kas/blog/ |
Please don't top post and in particular don't attach entire digests to your
mail or we'll all soon be using bittorrent to read the list.     --Alan Cox