Skip to content

Commit 31590ac

Browse files
committed
volume: avoid use-after-free in init error path
On an invalid ramp type the init error path freed the component data then read a field from it. Free the dependent allocation before the component data and stop dereferencing it afterwards. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 3f7738d commit 31590ac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/audio/volume/volume_ipc3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ int volume_init(struct processing_module *mod)
157157
break;
158158
default:
159159
comp_err(dev, "invalid ramp type %d", vol->ramp);
160-
mod_free(mod, cd);
161160
mod_free(mod, cd->vol);
161+
mod_free(mod, cd);
162162
return -EINVAL;
163163
}
164164

0 commit comments

Comments
 (0)