summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/linus/0043-drivers-atm-atmtcp.c-add-missing-atm_dev_put.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0043-drivers-atm-atmtcp.c-add-missing-atm_dev_put.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap/linus/0043-drivers-atm-atmtcp.c-add-missing-atm_dev_put.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0043-drivers-atm-atmtcp.c-add-missing-atm_dev_put.patch b/extras/recipes-kernel/linux/linux-omap/linus/0043-drivers-atm-atmtcp.c-add-missing-atm_dev_put.patch
new file mode 100644
index 00000000..20077bf9
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap/linus/0043-drivers-atm-atmtcp.c-add-missing-atm_dev_put.patch
@@ -0,0 +1,50 @@
1From 0af81f1e48cd0f4a1cdce5939408e1d9ad508190 Mon Sep 17 00:00:00 2001
2From: Julia Lawall <julia@diku.dk>
3Date: Wed, 29 Dec 2010 04:01:03 +0000
4Subject: [PATCH 43/65] drivers/atm/atmtcp.c: add missing atm_dev_put
5
6The earlier call to atm_dev_lookup increases the reference count of dev,
7so decrease it on the way out.
8
9The semantic match that finds this problem is as follows:
10(http://coccinelle.lip6.fr/)
11
12// <smpl>
13@@
14expression x, E;
15constant C;
16@@
17
18x = atm_dev_lookup(...);
19... when != false x != NULL
20 when != true x == NULL
21 when != \(E = x\|x = E\)
22 when != atm_dev_put(dev);
23*return -C;
24// </smpl>
25
26Signed-off-by: Julia Lawall <julia@diku.dk>
27Signed-off-by: David S. Miller <davem@davemloft.net>
28---
29 drivers/atm/atmtcp.c | 5 ++++-
30 1 files changed, 4 insertions(+), 1 deletions(-)
31
32diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c
33index 2b464b6..0b06250 100644
34--- a/drivers/atm/atmtcp.c
35+++ b/drivers/atm/atmtcp.c
36@@ -392,7 +392,10 @@ static int atmtcp_attach(struct atm_vcc *vcc,int itf)
37 atm_dev_put(dev);
38 return -EMEDIUMTYPE;
39 }
40- if (PRIV(dev)->vcc) return -EBUSY;
41+ if (PRIV(dev)->vcc) {
42+ atm_dev_put(dev);
43+ return -EBUSY;
44+ }
45 }
46 else {
47 int error;
48--
491.6.6.1
50