aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-01-01 16:08:10 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:05:02 -0500
commitf37fdf3ff744bffc35a8f1b9d7d655d8d88a0404 (patch)
tree21c73351ab02291f5c579bed18ea4e88ee5ec98f
parenta2a9b1eceb50993ef9e126dffc2f678fd6602158 (diff)
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>
-rw-r--r--drivers/media/radio/radio-maestro.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c
index 8e33a19a22a3..bc51f4d23a5a 100644
--- a/drivers/media/radio/radio-maestro.c
+++ b/drivers/media/radio/radio-maestro.c
@@ -423,7 +423,7 @@ static int __devinit maestro_probe(struct pci_dev *pdev,
423errunr: 423errunr:
424 video_unregister_device(maestro_radio_inst); 424 video_unregister_device(maestro_radio_inst);
425errfr1: 425errfr1:
426 kfree(maestro_radio_inst); 426 video_device_release(maestro_radio_inst);
427errfr: 427errfr:
428 kfree(radio_unit); 428 kfree(radio_unit);
429err: 429err: