From e53a99eb154d1ab6a7ddcaa960b4bddc701c7c2d Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 24 Jul 2012 11:06:09 -0300 Subject: [media] drivers/staging/media/easycap/easycap_main.c: add missing usb_free_urb Add missing usb_free_urb on failure path after usb_alloc_urb. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @km exists@ local idexpression e; expression e1,e2,e3; type T,T1; identifier f; @@ * e = usb_alloc_urb(...) ... when any when != e = e1 when != e1 = (T)e when != e1(...,(T)e,...) when != &e->f if(...) { ... when != e2(...,(T1)e,...) when != e3 = e when forall ( return <+...e...+>; | * return ...; ) } // Signed-off-by: Julia Lawall Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/easycap/easycap_main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/staging') diff --git a/drivers/staging/media/easycap/easycap_main.c b/drivers/staging/media/easycap/easycap_main.c index aed953751a90..19d2d9d64236 100644 --- a/drivers/staging/media/easycap/easycap_main.c +++ b/drivers/staging/media/easycap/easycap_main.c @@ -3083,6 +3083,7 @@ static int create_video_urbs(struct easycap *peasycap) peasycap->allocation_video_urb += 1; pdata_urb = kzalloc(sizeof(struct data_urb), GFP_KERNEL); if (!pdata_urb) { + usb_free_urb(purb); SAM("ERROR: Could not allocate struct data_urb.\n"); return -ENOMEM; } -- cgit v1.2.3 From cadc7920acd7d8fadfe98a33068af764e3247da0 Mon Sep 17 00:00:00 2001 From: Emil Goode Date: Sat, 7 Jul 2012 14:53:25 -0300 Subject: [media] lirc: fix non-ANSI function declaration warning Sparse is warning about non-ANSI function declaration. Add void to the parameterless function. drivers/staging/media/lirc/lirc_bt829.c:174:22: warning: non-ANSI function declaration of function 'poll_main' Signed-off-by: Emil Goode Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/lirc/lirc_bt829.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging') diff --git a/drivers/staging/media/lirc/lirc_bt829.c b/drivers/staging/media/lirc/lirc_bt829.c index 4d20e9f74118..951007a3fc96 100644 --- a/drivers/staging/media/lirc/lirc_bt829.c +++ b/drivers/staging/media/lirc/lirc_bt829.c @@ -171,7 +171,7 @@ static void cycle_delay(int cycle) } -static int poll_main() +static int poll_main(void) { unsigned char status_high, status_low; -- cgit v1.2.3 From 1a3acd3d7f1f7ba1037cfd8c04a9159988f70079 Mon Sep 17 00:00:00 2001 From: Devendra Naga Date: Tue, 10 Jul 2012 02:43:48 -0300 Subject: [media] staging/media/dt3155v4l: use module_pci_driver macro the driver duplicates the module_pci_driver code, remove the duplicate code and use the module_pci_driver macro. Signed-off-by: Devendra Naga Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/dt3155v4l/dt3155v4l.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c index c365cdf714ea..ebe5a27c06f5 100644 --- a/drivers/staging/media/dt3155v4l/dt3155v4l.c +++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c @@ -971,20 +971,7 @@ static struct pci_driver pci_driver = { .remove = __devexit_p(dt3155_remove), }; -static int __init -dt3155_init_module(void) -{ - return pci_register_driver(&pci_driver); -} - -static void __exit -dt3155_exit_module(void) -{ - pci_unregister_driver(&pci_driver); -} - -module_init(dt3155_init_module); -module_exit(dt3155_exit_module); +module_pci_driver(pci_driver); MODULE_DESCRIPTION("video4linux pci-driver for dt3155 frame grabber"); MODULE_AUTHOR("Marin Mitov "); -- cgit v1.2.3 From b1f093ac6807a264100b24b1a4939cff6e35c144 Mon Sep 17 00:00:00 2001 From: Devendra Naga Date: Tue, 10 Jul 2012 02:45:26 -0300 Subject: [media] staging/media/solo6x10: use module_pci_driver macro the driver duplicates the module_pci_driver code, how? module_pci_driver is used for those drivers whose init and exit paths does only register and unregister to pci API and nothing else. so use the module_pci_driver macro instead Signed-off-by: Devendra Naga Acked-by: Ismael Luceno Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/solo6x10/core.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/media/solo6x10/core.c b/drivers/staging/media/solo6x10/core.c index d2fd842e37cf..3ee9b125797f 100644 --- a/drivers/staging/media/solo6x10/core.c +++ b/drivers/staging/media/solo6x10/core.c @@ -318,15 +318,4 @@ static struct pci_driver solo_pci_driver = { .remove = solo_pci_remove, }; -static int __init solo_module_init(void) -{ - return pci_register_driver(&solo_pci_driver); -} - -static void __exit solo_module_exit(void) -{ - pci_unregister_driver(&solo_pci_driver); -} - -module_init(solo_module_init); -module_exit(solo_module_exit); +module_pci_driver(solo_pci_driver); -- cgit v1.2.3