Skip to contentSkip to conversation

workqueue: remove unnecessary goto statement

PATCH New Libin 1 participant 1 message Aug 24, 2013 Workqueue

lore
Share & tools
lore

Libin

author
#0 lore raw

PATCH 1/1 workqueue: remove unnecessary goto statement

Using return NULL to replace goto statement and avoiding a redundant function call for free_workqueue_attrs(). If kzalloc for attrs of struct workqueue_attrs is failed, alloc_workqueue_attrs return NULL directedly. With no functional changs.

---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
index 7f5d4be..dabeb88 100644
@@ -3400,7 +3400,7 @@ struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask)
 
 	attrs = kzalloc(sizeof(*attrs), gfp_mask);
 	if (!attrs)
-		goto fail;
+		return NULL;
 	if (!alloc_cpumask_var(&attrs->cpumask, gfp_mask))
 		goto fail;
 
Signature · 1 line
1.8.2.1