diff options
author | Julia Lawall <julia@diku.dk> | 2010-12-28 23:01:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-31 15:52:05 -0500 |
commit | b9556f9a1abdc56a179ac7ba6053469373b6de0f (patch) | |
tree | 8302a502a8428884a0163b526b057fb92831ff35 /drivers | |
parent | f4d5900a99dbc354ef1ba384d445ff80ae4d77b4 (diff) |
drivers/atm/atmtcp.c: add missing atm_dev_put
The earlier call to atm_dev_lookup increases the reference count of dev,
so decrease it on the way out.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x, E;
constant C;
@@
x = atm_dev_lookup(...);
... when != false x != NULL
when != true x == NULL
when != \(E = x\|x = E\)
when != atm_dev_put(dev);
*return -C;
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/atm/atmtcp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index 2b464b631f22..0b0625054a87 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c | |||
@@ -392,7 +392,10 @@ static int atmtcp_attach(struct atm_vcc *vcc,int itf) | |||
392 | atm_dev_put(dev); | 392 | atm_dev_put(dev); |
393 | return -EMEDIUMTYPE; | 393 | return -EMEDIUMTYPE; |
394 | } | 394 | } |
395 | if (PRIV(dev)->vcc) return -EBUSY; | 395 | if (PRIV(dev)->vcc) { |
396 | atm_dev_put(dev); | ||
397 | return -EBUSY; | ||
398 | } | ||
396 | } | 399 | } |
397 | else { | 400 | else { |
398 | int error; | 401 | int error; |