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: Kangjie Lu <kjlu@umn.edu> Reviewed-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d5cac52c09
commit
b5af36e3e5
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue