diff options
author | Cong Wang <amwang@redhat.com> | 2013-03-03 11:28:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-04 14:12:06 -0500 |
commit | 3f736868b47687d1336fe88185560b22bb92021e (patch) | |
tree | 6fbd420fb8762de6b951f1ee51ccacce75ea9791 /net/sctp | |
parent | ece6b0a2b25652d684a7ced4ae680a863af041e0 (diff) |
sctp: use KMALLOC_MAX_SIZE instead of its own MAX_KMALLOC_SIZE
Don't definite its own MAX_KMALLOC_SIZE, use the one
defined in mm.
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Sridhar Samudrala <sri@us.ibm.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/ssnmap.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c index 442ad4ed6315..825ea94415b3 100644 --- a/net/sctp/ssnmap.c +++ b/net/sctp/ssnmap.c | |||
@@ -41,8 +41,6 @@ | |||
41 | #include <net/sctp/sctp.h> | 41 | #include <net/sctp/sctp.h> |
42 | #include <net/sctp/sm.h> | 42 | #include <net/sctp/sm.h> |
43 | 43 | ||
44 | #define MAX_KMALLOC_SIZE 131072 | ||
45 | |||
46 | static struct sctp_ssnmap *sctp_ssnmap_init(struct sctp_ssnmap *map, __u16 in, | 44 | static struct sctp_ssnmap *sctp_ssnmap_init(struct sctp_ssnmap *map, __u16 in, |
47 | __u16 out); | 45 | __u16 out); |
48 | 46 | ||
@@ -65,7 +63,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, | |||
65 | int size; | 63 | int size; |
66 | 64 | ||
67 | size = sctp_ssnmap_size(in, out); | 65 | size = sctp_ssnmap_size(in, out); |
68 | if (size <= MAX_KMALLOC_SIZE) | 66 | if (size <= KMALLOC_MAX_SIZE) |
69 | retval = kmalloc(size, gfp); | 67 | retval = kmalloc(size, gfp); |
70 | else | 68 | else |
71 | retval = (struct sctp_ssnmap *) | 69 | retval = (struct sctp_ssnmap *) |
@@ -82,7 +80,7 @@ struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, | |||
82 | return retval; | 80 | return retval; |
83 | 81 | ||
84 | fail_map: | 82 | fail_map: |
85 | if (size <= MAX_KMALLOC_SIZE) | 83 | if (size <= KMALLOC_MAX_SIZE) |
86 | kfree(retval); | 84 | kfree(retval); |
87 | else | 85 | else |
88 | free_pages((unsigned long)retval, get_order(size)); | 86 | free_pages((unsigned long)retval, get_order(size)); |
@@ -124,7 +122,7 @@ void sctp_ssnmap_free(struct sctp_ssnmap *map) | |||
124 | int size; | 122 | int size; |
125 | 123 | ||
126 | size = sctp_ssnmap_size(map->in.len, map->out.len); | 124 | size = sctp_ssnmap_size(map->in.len, map->out.len); |
127 | if (size <= MAX_KMALLOC_SIZE) | 125 | if (size <= KMALLOC_MAX_SIZE) |
128 | kfree(map); | 126 | kfree(map); |
129 | else | 127 | else |
130 | free_pages((unsigned long)map, get_order(size)); | 128 | free_pages((unsigned long)map, get_order(size)); |