[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130417125729.GC5149@hmsreliant.think-freely.org>
Date: Wed, 17 Apr 2013 08:57:30 -0400
From: Neil Horman <nhorman@...driver.com>
To: Daniel Borkmann <dborkman@...hat.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-sctp@...r.kernel.org
Subject: Re: [PATCH net-next 3/9] net: sctp: sctp_outq: remove 'malloced'
from its struct
On Tue, Apr 16, 2013 at 11:07:12PM +0200, Daniel Borkmann wrote:
> sctp_outq is embedded into sctp_association, and thus never
> kmalloced in any way. Also, malloced is always 0, thus kfree()
> is never called. Therefore, remove that dead piece of code.
>
> Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
> ---
> include/net/sctp/structs.h | 3 ---
> net/sctp/outqueue.c | 6 ------
> 2 files changed, 9 deletions(-)
>
> diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
> index 125a19c..73fd5de 100644
> --- a/include/net/sctp/structs.h
> +++ b/include/net/sctp/structs.h
> @@ -1059,9 +1059,6 @@ struct sctp_outq {
>
> /* Is this structure empty? */
> char empty;
> -
> - /* Are we kfree()able? */
> - char malloced;
> };
>
> void sctp_outq_init(struct sctp_association *, struct sctp_outq *);
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 01dca75..d4c137e 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -217,8 +217,6 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
> q->outstanding_bytes = 0;
> q->empty = 1;
> q->cork = 0;
> -
> - q->malloced = 0;
> q->out_qlen = 0;
> }
>
> @@ -295,10 +293,6 @@ void sctp_outq_free(struct sctp_outq *q)
> {
> /* Throw away leftover chunks. */
> __sctp_outq_teardown(q);
> -
> - /* If we were kmalloc()'d, free the memory. */
> - if (q->malloced)
> - kfree(q);
> }
>
> /* Put a new chunk in an sctp_outq. */
> --
> 1.7.11.7
>
Acked-by: Neil Horman <nhorman@...driver.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists