linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] greybus: audio_manager: fix a missing check of ida_simple_get
@ 2019-03-14  6:45 Kangjie Lu
  2019-03-14  9:08 ` [greybus-dev] " Viresh Kumar
  2019-03-15  5:19 ` Vaibhav Agarwal
  0 siblings, 2 replies; 4+ messages in thread
From: Kangjie Lu @ 2019-03-14  6:45 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Vaibhav Agarwal, Mark Greer, Johan Hovold, Alex Elder,
	Greg Kroah-Hartman, greybus-dev, devel, linux-kernel

ida_simple_get could fail. The fix inserts a check for its
return value.

Signed-off-by: Kangjie Lu <kjlu@umn.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) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-30 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14  6:45 [PATCH] greybus: audio_manager: fix a missing check of ida_simple_get Kangjie Lu
2019-03-14  9:08 ` [greybus-dev] " Viresh Kumar
2019-03-15  5:19 ` Vaibhav Agarwal
2019-04-30 15:19   ` Mark Greer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).