Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

greybus: audio: gb_manager: Use valid argument while removing ida allocated id.

module->id is used as an argument to ida_simple_remove(). Since module
is already dereferenced, module->id might contain invalid data. So fix
this.

Fixes: da4cc2d0b066 ("audio:gb_manager: Use proper locking around kobject_xxx")
Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

authored by

Vaibhav Agarwal and committed by
Greg Kroah-Hartman
ac00154a ef62adae

+1 -1
+1 -1
drivers/staging/greybus/audio_manager.c
··· 76 76 list_del(&module->list); 77 77 kobject_put(&module->kobj); 78 78 up_write(&modules_rwsem); 79 - ida_simple_remove(&module_id, module->id); 79 + ida_simple_remove(&module_id, id); 80 80 return 0; 81 81 } 82 82 EXPORT_SYMBOL_GPL(gb_audio_manager_remove);