diff options
| author | Julia Lawall <julia@diku.dk> | 2008-01-11 22:03:42 -0300 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 19:05:02 -0200 |
| commit | a2a9b1eceb50993ef9e126dffc2f678fd6602158 (patch) | |
| tree | b1303c735608c5ebbe3eea800d6b2cd2ff080a9a /scripts/patch-kernel | |
| parent | V4L/DVB (7032): tda18271: tda18271_cal_on_startup should be declared static (diff) | |
| download | linux-a2a9b1eceb50993ef9e126dffc2f678fd6602158.tar.gz linux-a2a9b1eceb50993ef9e126dffc2f678fd6602158.zip | |
V4L/DVB (7035): drivers/media/common: Add missing video_device_release
Video_device_alloc returns the result of a kzalloc. In this case, the
value is stored in a local variable which is not copied elsewhere before
the point of the error return (video_register_device does not save its
first argument anywhere if it returns a negative value). Thus, a
video_device_release it needed before the error return.
The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
type T,T1,T2;
identifier E;
statement S;
expression x1,x2,x3;
int ret;
@@
T E;
...
* E = video_device_alloc(...);
if (E == NULL) S
... when != video_device_release(...,(T1)E,...)
when != if (E != NULL) { ... video_device_release(...,(T1)E,...); ...}
when != x1 = (T1)E
when != E = x3;
when any
if (...) {
... when != video_device_release(...,(T2)E,...)
when != if (E != NULL) { ... video_device_release(...,(T2)E,...); ...}
when != x2 = (T2)E
(
* return;
|
* return ret;
)
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
CC: Oliver Endriss <o.endriss@gmx.de>
CC: Michael Hunold <michael@mihu.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'scripts/patch-kernel')
0 files changed, 0 insertions, 0 deletions
