The gb_audio_manager_get_module() is EXPORT_SYMBOL, and will return NULL when incoming parameter id < 0, fix possible null-ptr-deref by add check for return value. Fixes: 8db00736d365 ("greybus: audio: Add Audio Manager") Signed-off-by: Yi Yang <yiyang13@xxxxxxxxxx> --- drivers/staging/greybus/audio_manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_manager.c b/drivers/staging/greybus/audio_manager.c index 27ca5f796c5f..1da8804e61ca 100644 --- a/drivers/staging/greybus/audio_manager.c +++ b/drivers/staging/greybus/audio_manager.c @@ -111,7 +111,8 @@ struct gb_audio_manager_module *gb_audio_manager_get_module(int id) down_read(&modules_rwsem); module = gb_audio_manager_get_locked(id); - kobject_get(&module->kobj); + if (module) + kobject_get(&module->kobj); up_read(&modules_rwsem); return module; } -- 2.25.1 _______________________________________________ greybus-dev mailing list -- greybus-dev@xxxxxxxxxxxxxxxx To unsubscribe send an email to greybus-dev-leave@xxxxxxxxxxxxxxxx