Commit 83f56f7c authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab

[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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 332b295d
...@@ -363,8 +363,7 @@ void au0828_rc_unregister(struct au0828_dev *dev) ...@@ -363,8 +363,7 @@ void au0828_rc_unregister(struct au0828_dev *dev)
if (!ir) if (!ir)
return; return;
if (ir->rc) rc_unregister_device(ir->rc);
rc_unregister_device(ir->rc);
/* done */ /* done */
kfree(ir); kfree(ir);
......
...@@ -841,8 +841,7 @@ static int em28xx_ir_fini(struct em28xx *dev) ...@@ -841,8 +841,7 @@ static int em28xx_ir_fini(struct em28xx *dev)
if (!ir) if (!ir)
goto ref_put; goto ref_put;
if (ir->rc) rc_unregister_device(ir->rc);
rc_unregister_device(ir->rc);
kfree(ir->i2c_client); kfree(ir->i2c_client);
......
...@@ -80,7 +80,7 @@ static void pvr2_context_set_notify(struct pvr2_context *mp, int fl) ...@@ -80,7 +80,7 @@ static void pvr2_context_set_notify(struct pvr2_context *mp, int fl)
static void pvr2_context_destroy(struct pvr2_context *mp) static void pvr2_context_destroy(struct pvr2_context *mp)
{ {
pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (destroy)",mp); pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context %p (destroy)",mp);
if (mp->hdw) pvr2_hdw_destroy(mp->hdw); pvr2_hdw_destroy(mp->hdw);
pvr2_context_set_notify(mp, 0); pvr2_context_set_notify(mp, 0);
mutex_lock(&pvr2_context_mutex); mutex_lock(&pvr2_context_mutex);
if (mp->exist_next) { if (mp->exist_next) {
......
...@@ -1974,8 +1974,7 @@ static int s2255_release_sys_buffers(struct s2255_vc *vc) ...@@ -1974,8 +1974,7 @@ static int s2255_release_sys_buffers(struct s2255_vc *vc)
{ {
unsigned long i; unsigned long i;
for (i = 0; i < SYS_FRAMES; i++) { for (i = 0; i < SYS_FRAMES; i++) {
if (vc->buffer.frame[i].lpvbits) vfree(vc->buffer.frame[i].lpvbits);
vfree(vc->buffer.frame[i].lpvbits);
vc->buffer.frame[i].lpvbits = NULL; vc->buffer.frame[i].lpvbits = NULL;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment