Netdev List
 help / color / mirror / Atom feed
* [PATCH] net/netlabel/netlabel_kapi.c: add missing cleanup code
@ 2011-08-11  9:40 Julia Lawall
  2011-08-11  9:44 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2011-08-11  9:40 UTC (permalink / raw)
  To: Paul Moore; +Cc: kernel-janitors, David S. Miller, netdev, linux-kernel

From: Julia Lawall <julia@diku.dk>

Use the same cleanup code for the failure of kzalloc as for the failure of
kstrdup just below.

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 net/netlabel/netlabel_kapi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 58107d0..225e12c 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -341,7 +341,7 @@ int netlbl_cfg_cipsov4_map_add(u32 doi,
 
 	entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
 	if (entry == NULL)
-		return -ENOMEM;
+		goto cfg_cipsov4_map_add_failure;
 	if (domain != NULL) {
 		entry->domain = kstrdup(domain, GFP_ATOMIC);
 		if (entry->domain == NULL)


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

end of thread, other threads:[~2011-08-11 12:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11  9:40 [PATCH] net/netlabel/netlabel_kapi.c: add missing cleanup code Julia Lawall
2011-08-11  9:44 ` Dan Carpenter
2011-08-11  9:52   ` Julia Lawall
2011-08-11 10:06     ` Julia Lawall
2011-08-11 12:53       ` David Miller

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