From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964936AbdKBXgY (ORCPT ); Thu, 2 Nov 2017 19:36:24 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:33034 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964862AbdKBXgW (ORCPT ); Thu, 2 Nov 2017 19:36:22 -0400 Date: Fri, 3 Nov 2017 00:35:53 +0100 From: Florian Westphal To: Charlie Sale Cc: pablo@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Net: netfilter: Moved vmalloc call to kmalloc call Message-ID: <20171102233553.GE9424@breakpoint.cc> References: <20171102231727.12610-1-chucks.8090@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171102231727.12610-1-chucks.8090@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Charlie Sale 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.