[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190314090838.ort5tluai4t2zvcu@vireshk-i7>
Date: Thu, 14 Mar 2019 14:38:38 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Kangjie Lu <kjlu@....edu>
Cc: devel@...verdev.osuosl.org, Alex Elder <elder@...nel.org>,
Johan Hovold <johan@...nel.org>, greybus-dev@...ts.linaro.org,
pakki001@....edu, linux-kernel@...r.kernel.org
Subject: Re: [greybus-dev] [PATCH] greybus: audio_manager: fix a missing
check of ida_simple_get
On 14-03-19, 01:45, Kangjie Lu wrote:
> ida_simple_get could fail. The fix inserts a check for its
> return value.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> ---
> 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) {
Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
--
viresh
Powered by blists - more mailing lists