aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-05-26 01:55:10 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-29 03:18:48 -0400
commite72e9f3814cb8c1076d627c29cec90b005838ac3 (patch)
tree312f828a60083afa2664d0cfc37115acb1986fd0 /drivers/isdn
parent32f6249ba7d63d5d86dae930d63ca70ec11d59af (diff)
drivers/isdn/hardware/mISDN: Add missing spin_unlock
Add a spin_unlock missing on the error path. The return value of write_reg seems to be completely ignored, so it seems that the lock should be released in every case. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression E1; @@ * spin_lock(E1,...); <+... when != E1 if (...) { ... when != E1 * return ...; } ...+> * spin_unlock(E1,...); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hardware/mISDN/hfcsusb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c
index b3b7e2879bac..8700474747e8 100644
--- a/drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/drivers/isdn/hardware/mISDN/hfcsusb.c
@@ -97,8 +97,10 @@ static int write_reg(struct hfcsusb *hw, __u8 reg, __u8 val)
97 hw->name, __func__, reg, val); 97 hw->name, __func__, reg, val);
98 98
99 spin_lock(&hw->ctrl_lock); 99 spin_lock(&hw->ctrl_lock);
100 if (hw->ctrl_cnt >= HFC_CTRL_BUFSIZE) 100 if (hw->ctrl_cnt >= HFC_CTRL_BUFSIZE) {
101 spin_unlock(&hw->ctrl_lock);
101 return 1; 102 return 1;
103 }
102 buf = &hw->ctrl_buff[hw->ctrl_in_idx]; 104 buf = &hw->ctrl_buff[hw->ctrl_in_idx];
103 buf->hfcs_reg = reg; 105 buf->hfcs_reg = reg;
104 buf->reg_val = val; 106 buf->reg_val = val;