Skip to content

Commit

Permalink
staging: greybus: audio_manager: fix a missing check of ida_simple_get
Browse files Browse the repository at this point in the history
ida_simple_get could fail. The fix inserts a check for its
return value.

Signed-off-by: Kangjie Lu <[email protected]>
Reviewed-by: Vaibhav Agarwal <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
kengiter authored and gregkh committed Mar 29, 2019
1 parent d5cac52 commit b5af36e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/staging/greybus/audio_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ int gb_audio_manager_add(struct gb_audio_manager_module_descriptor *desc)
int err;

id = ida_simple_get(&module_id, 0, 0, GFP_KERNEL);
if (id < 0)
return id;

err = gb_audio_manager_module_create(&module, manager_kset,
id, desc);
if (err) {
Expand Down

0 comments on commit b5af36e

Please sign in to comment.