瀏覽代碼

ALSA: ctxfi: Remove null check before kfree

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>
Himanshu Jha 8 年之前
父節點
當前提交
39cdc62b1b
共有 2 個文件被更改,包括 4 次插入8 次删除
  1. 2 4
      sound/pci/ctxfi/ctresource.c
  2. 2 4
      sound/pci/ctxfi/ctsrc.c

+ 2 - 4
sound/pci/ctxfi/ctresource.c

@@ -258,10 +258,8 @@ error:
 
 
 int rsc_mgr_uninit(struct rsc_mgr *mgr)
 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)) {
 	if ((NULL != mgr->hw) && (NULL != mgr->ctrl_blk)) {
 		switch (mgr->type) {
 		switch (mgr->type) {

+ 2 - 4
sound/pci/ctxfi/ctsrc.c

@@ -702,10 +702,8 @@ error1:
 
 
 static int srcimp_rsc_uninit(struct srcimp *srcimp)
 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->ops = NULL;
 	srcimp->mgr = NULL;
 	srcimp->mgr = NULL;
 	rsc_uninit(&srcimp->rsc);
 	rsc_uninit(&srcimp->rsc);