mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] workqueue: remove unnecessary goto statement
@ 2013-08-24  0:34 Libin
  0 siblings, 0 replies; only message in thread
From: Libin @ 2013-08-24  0:34 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-kernel, wangyijing, guohanjun

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.

Signed-off-by: Libin <huawei.libin@huawei.com>
---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 7f5d4be..dabeb88 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -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;
 
-- 
1.8.2.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-24  0:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-24  0:34 [PATCH] workqueue: remove unnecessary goto statement Libin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®