projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: sctp: get rid of t_new macro for kzalloc
[deliverable/linux.git]
/
net
/
sctp
/
endpointola.c
diff --git
a/net/sctp/endpointola.c
b/net/sctp/endpointola.c
index 12ed45dbe75d6b779fd0dcf4d38f6126e23c03fb..a8b26741c0af868e6aab9277f01d311f54635c6b 100644
(file)
--- a/
net/sctp/endpointola.c
+++ b/
net/sctp/endpointola.c
@@
-121,8
+121,7
@@
static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
/* Initialize the basic object fields. */
atomic_set(&ep->base.refcnt, 1);
/* Initialize the basic object fields. */
atomic_set(&ep->base.refcnt, 1);
- ep->base.dead = 0;
- ep->base.malloced = 1;
+ ep->base.dead = false;
/* Create an input queue. */
sctp_inq_init(&ep->base.inqueue);
/* Create an input queue. */
sctp_inq_init(&ep->base.inqueue);
@@
-193,12
+192,13
@@
struct sctp_endpoint *sctp_endpoint_new(struct sock *sk, gfp_t gfp)
struct sctp_endpoint *ep;
/* Build a local endpoint. */
struct sctp_endpoint *ep;
/* Build a local endpoint. */
- ep =
t_new(struct sctp_endpoint
, gfp);
+ ep =
kzalloc(sizeof(*ep)
, gfp);
if (!ep)
goto fail;
if (!ep)
goto fail;
+
if (!sctp_endpoint_init(ep, sk, gfp))
goto fail_init;
if (!sctp_endpoint_init(ep, sk, gfp))
goto fail_init;
- ep->base.malloced = 1;
+
SCTP_DBG_OBJCNT_INC(ep);
return ep;
SCTP_DBG_OBJCNT_INC(ep);
return ep;
@@
-234,7
+234,7
@@
void sctp_endpoint_add_asoc(struct sctp_endpoint *ep,
*/
void sctp_endpoint_free(struct sctp_endpoint *ep)
{
*/
void sctp_endpoint_free(struct sctp_endpoint *ep)
{
- ep->base.dead =
1
;
+ ep->base.dead =
true
;
ep->base.sk->sk_state = SCTP_SS_CLOSED;
ep->base.sk->sk_state = SCTP_SS_CLOSED;
@@
-279,11
+279,8
@@
static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
if (ep->base.sk)
sock_put(ep->base.sk);
if (ep->base.sk)
sock_put(ep->base.sk);
- /* Finally, free up our memory. */
- if (ep->base.malloced) {
- kfree(ep);
- SCTP_DBG_OBJCNT_DEC(ep);
- }
+ kfree(ep);
+ SCTP_DBG_OBJCNT_DEC(ep);
}
/* Hold a reference to an endpoint. */
}
/* Hold a reference to an endpoint. */
This page took
0.030163 seconds
and
5
git commands to generate.