Skip to contentSkip to conversation

ucm: Set uc_mgr->ctl to NULL after closing it.

PATCH Applied Tanu Kaskinen 3 participants 3 messages Jan 26, 2013 – Jan 28, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ucm: Set uc_mgr->ctl to NULL after closing it.

Fixes a double-free bug.

---
 src/ucm/main.c |    1 +
 1 file changed, 1 insertion(+)
src/ucm/main.c +1 -0
index 0d7d841..d8b8ada 100644
@@ -145,6 +145,7 @@ static int open_ctl(snd_use_case_mgr_t *uc_mgr,
 		free(uc_mgr->ctl_dev);
 		uc_mgr->ctl_dev = NULL;
 		snd_ctl_close(uc_mgr->ctl);
+		uc_mgr->ctl = NULL;
 	
 	}
 	err = snd_ctl_open(ctl, ctl_dev, 0);
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Tanu Kaskinen

Fixes a double-free bug.

---
 src/ucm/main.c |    1 +
 1 file changed, 1 insertion(+)
src/ucm/main.c +0 -0
index 0d7d841..d8b8ada 100644

src/ucm/main.c static int open_ctl(snd_use_case_mgr_t *uc_mgr, · line 151

Quoted 7 lines
src/ucm/main.c +1 -0
@@ -145,6 +145,7 @@ static int open_ctl(snd_use_case_mgr_t *uc_mgr,
 		free(uc_mgr->ctl_dev);
 		uc_mgr->ctl_dev = NULL;
 		snd_ctl_close(uc_mgr->ctl);
+		uc_mgr->ctl = NULL;
 
 	}
 	err = snd_ctl_open(ctl, ctl_dev, 0);
Applied
#2 lore raw

At Mon, 28 Jan 2013 09:19:03 +0000,

Quoted 19 lines · Liam Girdwood
Quoted 17 lines · Tanu Kaskinen

Fixes a double-free bug.

---
 src/ucm/main.c |    1 +
 1 file changed, 1 insertion(+)
src/ucm/main.c +1 -0
index 0d7d841..d8b8ada 100644
@@ -145,6 +145,7 @@ static int open_ctl(snd_use_case_mgr_t *uc_mgr,
 		free(uc_mgr->ctl_dev);
 		uc_mgr->ctl_dev = NULL;
 		snd_ctl_close(uc_mgr->ctl);
+		uc_mgr->ctl = NULL;
 
Quoted 4 lines

src/ucm/main.c static int open_ctl(snd_use_case_mgr_t *uc_mgr, · line 151

Quoted 2 lines
src/ucm/main.c +0 -0
 	}
 	err = snd_ctl_open(ctl, ctl_dev, 0);

Thanks, applied now.

Takashi