diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-12 01:03:42 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-12 01:03:42 +0000 |
commit | f9b21f5047b96957a8e24bc7d8692be6af1929c0 (patch) | |
tree | 99d6925debe83ecac3af8787ba0f335f644cb680 /linux/drivers/media/dvb/frontends/sp8870.h | |
parent | 8e7367e788bd47a6a6fa5ab79b290d3b343a7899 (diff) | |
download | mediapointer-dvb-s2-f9b21f5047b96957a8e24bc7d8692be6af1929c0.tar.gz mediapointer-dvb-s2-f9b21f5047b96957a8e24bc7d8692be6af1929c0.tar.bz2 |
drivers/media/common: Add missing video_device_release
From: Julia Lawall <julia@diku.dk>
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>
CC: Oliver Endriss <o.endriss@gmx.de>
CC: Michael Hunold <michael@mihu.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/sp8870.h')
0 files changed, 0 insertions, 0 deletions