ALSA: ctxfi: Remove null check before kfree
authorHimanshu Jha <himanshujha199640@gmail.com>
Thu, 31 Aug 2017 15:06:42 +0000 (20:36 +0530)
committerTakashi Iwai <tiwai@suse.de>
Thu, 31 Aug 2017 18:10:30 +0000 (20:10 +0200)
kfree on NULL pointer is a no-op and therefore checking is redundant.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ctxfi/ctresource.c
sound/pci/ctxfi/ctsrc.c

index c5124c3c0fd192bb8d25528f779b7755d748d057..80c4d84f9667f25601c8f7f878cd9c5bde8db05d 100644 (file)
@@ -258,10 +258,8 @@ error:
 
 int rsc_mgr_uninit(struct rsc_mgr *mgr)
 {
-       if (NULL != mgr->rscs) {
-               kfree(mgr->rscs);
-               mgr->rscs = NULL;
-       }
+       kfree(mgr->rscs);
+       mgr->rscs = NULL;
 
        if ((NULL != mgr->hw) && (NULL != mgr->ctrl_blk)) {
                switch (mgr->type) {
index a5a72df298013faae602f1cdcb95a7b4cda3d865..bb4c9c3c89aee0c26583096b9a23c1b8d986b5d6 100644 (file)
@@ -702,10 +702,8 @@ error1:
 
 static int srcimp_rsc_uninit(struct srcimp *srcimp)
 {
-       if (NULL != srcimp->imappers) {
-               kfree(srcimp->imappers);
-               srcimp->imappers = NULL;
-       }
+       kfree(srcimp->imappers);
+       srcimp->imappers = NULL;
        srcimp->ops = NULL;
        srcimp->mgr = NULL;
        rsc_uninit(&srcimp->rsc);