linux/drivers/isdn
Julia Lawall 4d5392cc4d drivers/isdn/capi/kcapi.c: Adjust error handling code involving capi_ctr_put
After calling capi_ctr_get, error handling code should call capi_ctr_put.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r@
expression x,E;
statement S;
position p1,p2,p3;
@@

(
if ((x = capi_ctr_get@p1(...)) == NULL || ...) S
|
x = capi_ctr_get@p1(...)
... when != x
if (x == NULL || ...) S
)
<...
if@p3 (...) { ... when != capi_ctr_put(x)
                  when != if (x) { ... capi_ctr_put(x); ...}
    return@p2 ...;
}
...>
(
return x;
|
return 0;
|
x = E
|
E = x
|
capi_ctr_put(x)
)

@exists@
position r.p1,r.p2,r.p3;
expression x;
int ret != 0;
statement S;
@@

* x = capi_ctr_get@p1(...)
  <...
* if@p3 (...)
  S
  ...>
* return@p2 \(NULL\|ret\);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-22 19:04:54 -07:00
..
act2000 fix ! versus & precedence in various places 2008-02-06 10:40:59 -08:00
capi drivers/isdn/capi/kcapi.c: Adjust error handling code involving capi_ctr_put 2008-09-22 19:04:54 -07:00
divert isdn: use non-racy method for proc entries creation 2008-04-29 08:06:22 -07:00
gigaset isdn: use the common ascii hex helpers 2008-07-30 16:40:22 -07:00
hardware Add DIP switch readout for HFC-4S IOB4ST 2008-08-02 16:40:37 +02:00
hisax pnp: fix the fcpnp_driver declaration to only exist if CONFIG_PNP=y 2008-07-26 12:00:02 -07:00
hysdn hysdn: remove the packed attribute from PofTimStamp_tag 2008-07-30 16:48:05 -07:00
i4l isdn: isdn_ppp: Use SKB list facilities instead of home-grown implementation. 2008-09-22 01:15:02 -07:00
icn fix ! versus & precedence in various places 2008-02-06 10:40:59 -08:00
isdnloop drivers/isdn: correct use of ! and & 2008-03-04 16:35:16 -08:00
mISDN mISDN cleanup user interface 2008-08-02 16:28:50 +02:00
pcbit Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
sc drivers/isdn/sc/ioctl.c: add missing kfree 2008-06-12 18:05:41 -07:00
Kconfig Add mISDN driver 2008-07-27 01:46:33 +02:00
Makefile mISDN fix main ISDN Makefile 2008-08-02 16:28:20 +02:00