From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752964AbcHUCMg convert rfc822-to-8bit (ORCPT ); Sat, 20 Aug 2016 22:12:36 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:34167 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752727AbcHUCMe (ORCPT ); Sat, 20 Aug 2016 22:12:34 -0400 Date: Sat, 20 Aug 2016 19:12:33 -0700 (PDT) Message-Id: <20160820.191233.1040358497240261402.davem@davemloft.net> To: christophe.jaillet@wanadoo.fr Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] wan-cosa: Use memdup_user() rather than duplicating its implementation From: David Miller In-Reply-To: References: <5d335025-5f52-d4b6-0b60-89a2fd354694@users.sourceforge.net> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 20 Aug 2016 19:12:34 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET Date: Sat, 20 Aug 2016 10:42:54 +0200 > Le 20/08/2016 à 10:25, SF Markus Elfring a écrit : >> @@ -875,16 +875,10 @@ static ssize_t cosa_write(struct file *file, >> if (count > COSA_MTU) >> count = COSA_MTU; >> >> - /* Allocate the buffer */ >> - kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA); > In this case, 'memdup_user()' has a different meaning, as GFP_DMA will > no more be used for this memory allocation. Agreed, this transformation is not equivalent. Markus, please do not make these changes so blindly.