diff options
-rw-r--r-- | include/net/sctp/structs.h | 1 | ||||
-rw-r--r-- | net/sctp/ssnmap.c | 23 |
2 files changed, 12 insertions, 12 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index e12aa77abc59..3c1bb8dd1e26 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -399,7 +399,6 @@ struct sctp_stream { | |||
399 | struct sctp_ssnmap { | 399 | struct sctp_ssnmap { |
400 | struct sctp_stream in; | 400 | struct sctp_stream in; |
401 | struct sctp_stream out; | 401 | struct sctp_stream out; |
402 | int malloced; | ||
403 | }; | 402 | }; |
404 | 403 | ||
405 | struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, | 404 | struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, |
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. */ |
119 | void sctp_ssnmap_free(struct sctp_ssnmap *map) | 118 | void 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 | } |