Commit b5af36e3 authored by Kangjie Lu's avatar Kangjie Lu Committed by Greg Kroah-Hartman

staging: greybus: audio_manager: fix a missing check of ida_simple_get

ida_simple_get could fail. The fix inserts a check for its
return value.
Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Reviewed-by: default avatarVaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d5cac52c
...@@ -45,6 +45,9 @@ int gb_audio_manager_add(struct gb_audio_manager_module_descriptor *desc) ...@@ -45,6 +45,9 @@ int gb_audio_manager_add(struct gb_audio_manager_module_descriptor *desc)
int err; int err;
id = ida_simple_get(&module_id, 0, 0, GFP_KERNEL); id = ida_simple_get(&module_id, 0, 0, GFP_KERNEL);
if (id < 0)
return id;
err = gb_audio_manager_module_create(&module, manager_kset, err = gb_audio_manager_module_create(&module, manager_kset,
id, desc); id, desc);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment