aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/ssnmap.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c
index 825ea94415b3..da8603523808 100644
--- a/net/sctp/ssnmap.c
+++ b/net/sctp/ssnmap.c
@@ -74,7 +74,6 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
74 if (!sctp_ssnmap_init(retval, in, out)) 74 if (!sctp_ssnmap_init(retval, in, out))
75 goto fail_map; 75 goto fail_map;
76 76
77 retval->malloced = 1;
78 SCTP_DBG_OBJCNT_INC(ssnmap); 77 SCTP_DBG_OBJCNT_INC(ssnmap);
79 78
80 return retval; 79 return retval;
@@ -118,14 +117,16 @@ void sctp_ssnmap_clear(struct sctp_ssnmap *map)
118/* Dispose of a ssnmap. */ 117/* Dispose of a ssnmap. */
119void sctp_ssnmap_free(struct sctp_ssnmap *map) 118void sctp_ssnmap_free(struct sctp_ssnmap *map)
120{ 119{
121 if (map && map->malloced) { 120 int size;
122 int size; 121
123 122 if (unlikely(!map))
124 size = sctp_ssnmap_size(map->in.len, map->out.len); 123 return;
125 if (size <= KMALLOC_MAX_SIZE) 124
126 kfree(map); 125 size = sctp_ssnmap_size(map->in.len, map->out.len);
127 else 126 if (size <= KMALLOC_MAX_SIZE)
128 free_pages((unsigned long)map, get_order(size)); 127 kfree(map);
129 SCTP_DBG_OBJCNT_DEC(ssnmap); 128 else
130 } 129 free_pages((unsigned long)map, get_order(size));
130
131 SCTP_DBG_OBJCNT_DEC(ssnmap);
131} 132}