Skip to content

Commit 39cdc62

Browse files
himanshujha199640tiwai
authored andcommitted
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 <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent c054c8a commit 39cdc62

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

sound/pci/ctxfi/ctresource.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,8 @@ int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type,
258258

259259
int rsc_mgr_uninit(struct rsc_mgr *mgr)
260260
{
261-
if (NULL != mgr->rscs) {
262-
kfree(mgr->rscs);
263-
mgr->rscs = NULL;
264-
}
261+
kfree(mgr->rscs);
262+
mgr->rscs = NULL;
265263

266264
if ((NULL != mgr->hw) && (NULL != mgr->ctrl_blk)) {
267265
switch (mgr->type) {

sound/pci/ctxfi/ctsrc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,8 @@ static int srcimp_rsc_init(struct srcimp *srcimp,
702702

703703
static int srcimp_rsc_uninit(struct srcimp *srcimp)
704704
{
705-
if (NULL != srcimp->imappers) {
706-
kfree(srcimp->imappers);
707-
srcimp->imappers = NULL;
708-
}
705+
kfree(srcimp->imappers);
706+
srcimp->imappers = NULL;
709707
srcimp->ops = NULL;
710708
srcimp->mgr = NULL;
711709
rsc_uninit(&srcimp->rsc);

0 commit comments

Comments
 (0)