diff options
author | Kangjie Lu <kjlu@umn.edu> | 2019-03-14 01:45:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-29 17:28:48 +0100 |
commit | b5af36e3e5aa074605a4d90a89dd8f714b30909b (patch) | |
tree | 68dd101bf05f1b2c84cf8d47bf88cc9a468329df /drivers/staging/greybus | |
parent | d5cac52c092ad9f97f00dc0647ad65ad795c97bc (diff) | |
download | blackbird-op-linux-b5af36e3e5aa074605a4d90a89dd8f714b30909b.tar.gz blackbird-op-linux-b5af36e3e5aa074605a4d90a89dd8f714b30909b.zip |
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>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r-- | drivers/staging/greybus/audio_manager.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/greybus/audio_manager.c b/drivers/staging/greybus/audio_manager.c index d44b070d8862..c2a4af4c1d06 100644 --- a/drivers/staging/greybus/audio_manager.c +++ b/drivers/staging/greybus/audio_manager.c @@ -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) { |