linux/drivers/media
Julia Lawall f37fdf3ff7 V4L/DVB (7036): radio: Use video_device_release rather than kfree
The file drivers/media/video/videodev.c defines both video_device_alloc and
video_device_release.  These are essentially just kzmalloc and kfree,
respectively, but it seems better to use video_device_release, as done in
the other media files, rather than kfree, in case the implementation some
day changes.

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: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-25 19:05:02 -02:00
..
common V4L/DVB (7035): drivers/media/common: Add missing video_device_release 2008-01-25 19:05:02 -02:00
dvb V4L/DVB (7032): tda18271: tda18271_cal_on_startup should be declared static 2008-01-25 19:05:01 -02:00
radio V4L/DVB (7036): radio: Use video_device_release rather than kfree 2008-01-25 19:05:02 -02:00
video V4L/DVB (7030): Kconfig: add missing selections for VIDEO_PVRUSB2 2008-01-25 19:05:01 -02:00
Kconfig V4L/DVB (6443): make tda9887 build selectable via Kconfig 2008-01-25 19:01:10 -02:00
Makefile V4L/DVB (6814): Makefile: always enter video/ 2007-12-13 17:58:05 -02:00