Commit e73790a5 authored by Julia Lawall's avatar Julia Lawall Committed by Linus Torvalds

drivers/char/n_gsm.c: add missing spin_unlock_irqrestore

Add a spin_unlock_irqrestore missing on the error path.  Converting the
return to break leads to the spin_unlock_irqrestore at the end of the
function.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E1;
@@

* spin_lock_irqsave(E1,...);
  <+... when != E1
  if (...) {
    ... when != E1
*   return ...;
  }
  ...+>
* spin_unlock_irqrestore(E1,...);
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7bb671e3
...@@ -919,7 +919,7 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm) ...@@ -919,7 +919,7 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm)
else else
len = gsm_dlci_data_output_framed(gsm, dlci); len = gsm_dlci_data_output_framed(gsm, dlci);
if (len < 0) if (len < 0)
return; break;
/* DLCI empty - try the next */ /* DLCI empty - try the next */
if (len == 0) if (len == 0)
i++; i++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment