staging: greybus: Use GFP_KERNEL for audio manager allocation
Subsystems (3)
PATCH 1/1 staging: greybus: Use GFP_KERNEL for audio manager allocation
The audio manager module is created in a context that permits sleeping. Its caller, gb_audio_manager_add(), already uses GFP_KERNEL through ida_alloc(), and module creation subsequently calls kobject_init_and_add().
GFP_ATOMIC is unnecessary in this context and restricts memory reclaim. Remove the explicit flag to use the default GFP_KERNEL allocation.
--- drivers/staging/greybus/audio_manager_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/audio_manager_module.c +1 -1
@@ -187,7 +187,7 @@ int gb_audio_manager_module_create(struct gb_audio_manager_module **module,int err;struct gb_audio_manager_module *m; - m =kzalloc_obj (*m,GFP_ATOMIC ); + m =kzalloc_obj (*m);if (!m)return -ENOMEM ;
Signature · 1 line
2.47.3
Quoted 10 lines · Torra Sowmya
The audio manager module is created in a context that permits sleeping. Its caller,
gb_audio_manager_add(), already usesGFP_KERNELthroughida_alloc(), and module creation subsequently callskobject_init_and_add().
GFP_ATOMICis unnecessary in this context and restricts memory reclaim. Remove the explicit flag to use the defaultGFP_KERNELallocation.Signed-off-by Torra Sowmya <[email protected]>
Looks good to me.
Quoted 17 lines
--- drivers/staging/greybus/audio_manager_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/greybus/audio_manager_module.c +1
-1@@ -187,7 +187,7 @@ int gb_audio_manager_module_create(struct gb_audio_manager_module **module,int err;struct gb_audio_manager_module *m; - m =kzalloc_obj (*m,GFP_ATOMIC ); + m =kzalloc_obj (*m);if (!m)return -ENOMEM ;