aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2014-11-20 07:26:36 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-25 10:31:52 -0500
commit83f56f7cbd070c0d9772221aa61198ef74c96cc4 (patch)
tree1c98474c7672437c189094872e248085cf842b9e /drivers/media
parent332b295d107466df8b05a99a914adbe21401449b (diff)
[media] USB: Deletion of unnecessary checks before three function calls
GIT_AUTHOR_DATE=1416486805 The functions pvr2_hdw_destroy(), rc_unregister_device() and vfree() perform also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/au0828/au0828-input.c3
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c3
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-context.c2
-rw-r--r--drivers/media/usb/s2255/s2255drv.c3
4 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/usb/au0828/au0828-input.c b/drivers/media/usb/au0828/au0828-input.c
index 63995f97dc65..11a8daec5939 100644
--- a/drivers/media/usb/au0828/au0828-input.c
+++ b/drivers/media/usb/au0828/au0828-input.c
@@ -363,8 +363,7 @@ void au0828_rc_unregister(struct au0828_dev *dev)
363 if (!ir) 363 if (!ir)
364 return; 364 return;
365 365
366 if (ir->rc) 366 rc_unregister_device(ir->rc);
367 rc_unregister_device(ir->rc);
368 367
369 /* done */ 368 /* done */
370 kfree(ir); 369 kfree(ir);
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index 23f8f6afa2e0..85ac7dd15700 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -841,8 +841,7 @@ static int em28xx_ir_fini(struct em28xx *dev)
841 if (!ir) 841 if (!ir)
842 goto ref_put; 842 goto ref_put;
843 843
844 if (ir->rc) 844 rc_unregister_device(ir->rc);
845 rc_unregister_device(ir->rc);
846 845
847 kfree(ir->i2c_client); 846 kfree(ir->i2c_client);
848 847
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
index 7c19ff72e6b3..c8761c71c9d2 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -80,7 +80,7 @@ static void pvr2_context_set_notify(struct pvr2_context *mp, int fl)
80static void pvr2_context_destroy(struct pvr2_context *mp) 80static void pvr2_context_destroy(struct pvr2_context *mp)
81{ 81{
82 pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (destroy)",mp); 82 pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (destroy)",mp);
83 if (mp->hdw) pvr2_hdw_destroy(mp->hdw); 83 pvr2_hdw_destroy(mp->hdw);
84 pvr2_context_set_notify(mp, 0); 84 pvr2_context_set_notify(mp, 0);
85 mutex_lock(&pvr2_context_mutex); 85 mutex_lock(&pvr2_context_mutex);
86 if (mp->exist_next) { 86 if (mp->exist_next) {
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index a56a05b0c4e1..e03b155fa5c7 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -1974,8 +1974,7 @@ static int s2255_release_sys_buffers(struct s2255_vc *vc)
1974{ 1974{
1975 unsigned long i; 1975 unsigned long i;
1976 for (i = 0; i < SYS_FRAMES; i++) { 1976 for (i = 0; i < SYS_FRAMES; i++) {
1977 if (vc->buffer.frame[i].lpvbits) 1977 vfree(vc->buffer.frame[i].lpvbits);
1978 vfree(vc->buffer.frame[i].lpvbits);
1979 vc->buffer.frame[i].lpvbits = NULL; 1978 vc->buffer.frame[i].lpvbits = NULL;
1980 } 1979 }
1981 return 0; 1980 return 0;