Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262785
b: refs/heads/master
c: 94a80d6
h: refs/heads/master
i:
  262783: 9e33043
v: v3
  • Loading branch information
Julia Lawall authored and David S. Miller committed Aug 11, 2011
1 parent 0bf441a commit e260bce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2eed7982d76f3a1627ba6536128a64b8e66ad189
refs/heads/master: 94a80d63b245c66745c1d72b8154f67b597e3b89
20 changes: 12 additions & 8 deletions trunk/net/netlabel/netlabel_kapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,11 @@ int netlbl_cfg_cipsov4_map_add(u32 doi,

entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
if (entry == NULL)
return -ENOMEM;
goto out_entry;
if (domain != NULL) {
entry->domain = kstrdup(domain, GFP_ATOMIC);
if (entry->domain == NULL)
goto cfg_cipsov4_map_add_failure;
goto out_domain;
}

if (addr == NULL && mask == NULL) {
Expand All @@ -354,13 +354,13 @@ int netlbl_cfg_cipsov4_map_add(u32 doi,
} else if (addr != NULL && mask != NULL) {
addrmap = kzalloc(sizeof(*addrmap), GFP_ATOMIC);
if (addrmap == NULL)
goto cfg_cipsov4_map_add_failure;
goto out_addrmap;
INIT_LIST_HEAD(&addrmap->list4);
INIT_LIST_HEAD(&addrmap->list6);

addrinfo = kzalloc(sizeof(*addrinfo), GFP_ATOMIC);
if (addrinfo == NULL)
goto cfg_cipsov4_map_add_failure;
goto out_addrinfo;
addrinfo->type_def.cipsov4 = doi_def;
addrinfo->type = NETLBL_NLTYPE_CIPSOV4;
addrinfo->list.addr = addr->s_addr & mask->s_addr;
Expand All @@ -374,7 +374,7 @@ int netlbl_cfg_cipsov4_map_add(u32 doi,
entry->type = NETLBL_NLTYPE_ADDRSELECT;
} else {
ret_val = -EINVAL;
goto cfg_cipsov4_map_add_failure;
goto out_addrmap;
}

ret_val = netlbl_domhsh_add(entry, audit_info);
Expand All @@ -384,11 +384,15 @@ int netlbl_cfg_cipsov4_map_add(u32 doi,
return 0;

cfg_cipsov4_map_add_failure:
cipso_v4_doi_putdef(doi_def);
kfree(addrinfo);
out_addrinfo:
kfree(addrmap);
out_addrmap:
kfree(entry->domain);
out_domain:
kfree(entry);
kfree(addrmap);
kfree(addrinfo);
out_entry:
cipso_v4_doi_putdef(doi_def);
return ret_val;
}

Expand Down

0 comments on commit e260bce

Please sign in to comment.