提交 39cdc62b 编写于 作者: H Himanshu Jha 提交者: Takashi Iwai

ALSA: ctxfi: Remove null check before kfree

kfree on NULL pointer is a no-op and therefore checking is redundant.
Signed-off-by: NHimanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 c054c8a0
...@@ -258,10 +258,8 @@ int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, ...@@ -258,10 +258,8 @@ int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type,
int rsc_mgr_uninit(struct rsc_mgr *mgr) int rsc_mgr_uninit(struct rsc_mgr *mgr)
{ {
if (NULL != mgr->rscs) { kfree(mgr->rscs);
kfree(mgr->rscs); mgr->rscs = NULL;
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) {
......
...@@ -702,10 +702,8 @@ static int srcimp_rsc_init(struct srcimp *srcimp, ...@@ -702,10 +702,8 @@ static int srcimp_rsc_init(struct srcimp *srcimp,
static int srcimp_rsc_uninit(struct srcimp *srcimp) static int srcimp_rsc_uninit(struct srcimp *srcimp)
{ {
if (NULL != srcimp->imappers) { kfree(srcimp->imappers);
kfree(srcimp->imappers); srcimp->imappers = NULL;
srcimp->imappers = NULL;
}
srcimp->ops = NULL; srcimp->ops = NULL;
srcimp->mgr = NULL; srcimp->mgr = NULL;
rsc_uninit(&srcimp->rsc); rsc_uninit(&srcimp->rsc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册