netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Charlie Sale <chucks.8090@gmail.com>
Cc: pablo@netfilter.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Net: netfilter: Moved vmalloc call to kmalloc call
Date: Fri, 3 Nov 2017 00:35:53 +0100	[thread overview]
Message-ID: <20171102233553.GE9424@breakpoint.cc> (raw)
In-Reply-To: <20171102231727.12610-1-chucks.8090@gmail.com>

Charlie Sale <chucks.8090@gmail.com> wrote:
> Fixed FIXME comment in code my changing a vmalloc call
> to a kmalloc call. Thought it would be a good place to
> start for a first patch.

Please at least compile test your patches.

> -	/* FIXME: don't use vmalloc() here or anywhere else -HW */
> -	hinfo = vmalloc(sizeof(struct xt_hashlimit_htable) +
> -	                sizeof(struct hlist_head) * size);
> +
> +	hinfo = kmalloc(sizeof(*hinfo) +
> +			sizeof(struct hlist_head) * size, GPT_KERNEL);

If anything this should be switched to kvmalloc, not kmalloc.

Also, hinfo cannot be free'd via vfree after this change, so you need to
adjust all free operations too.

  reply	other threads:[~2017-11-02 23:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 23:17 [PATCH] Net: netfilter: Moved vmalloc call to kmalloc call Charlie Sale
2017-11-02 23:35 ` Florian Westphal [this message]
2017-11-03  0:59 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171102233553.GE9424@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=chucks.8090@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).