Re: [PATCH] greybus: audio_manager: fix a missing check of ida_simple_get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 14, 2019 at 12:15 PM Kangjie Lu <kjlu@xxxxxxx> wrote:
>
> ida_simple_get could fail. The fix inserts a check for its
> return value.
>
> Signed-off-by: Kangjie Lu <kjlu@xxxxxxx>
> ---
>  drivers/staging/greybus/audio_manager.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> 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) {

Reviewed-by: Vaibhav Agarwal <vaibhav.sr@xxxxxxxxx>

--
./va
_______________________________________________
greybus-dev mailing list
greybus-dev@xxxxxxxxxxxxxxxx
https://lists.linaro.org/mailman/listinfo/greybus-dev




[Index of Archives]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]

  Powered by Linux