From patchwork Sun Oct 24 14:32:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 265602 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9OEWwEh032381 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 24 Oct 2010 14:33:19 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PA1cv-0006yf-8t; Sun, 24 Oct 2010 14:32:49 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PA1ct-0006ya-Gz for v9fs-developer@lists.sourceforge.net; Sun, 24 Oct 2010 14:32:47 +0000 X-ACL-Warn: Received: from e28smtp09.in.ibm.com ([122.248.162.9]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1PA1cq-0008An-OO for v9fs-developer@lists.sourceforge.net; Sun, 24 Oct 2010 14:32:47 +0000 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp09.in.ibm.com (8.14.4/8.13.1) with ESMTP id o9OE6ejV010821 for ; Sun, 24 Oct 2010 19:36:40 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9OEWZaF3453138 for ; Sun, 24 Oct 2010 20:02:35 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9OEWY36009502 for ; Mon, 25 Oct 2010 01:32:35 +1100 Received: from skywalker.linux.vnet.ibm.com ([9.124.220.36]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o9OEWWOi009486; Mon, 25 Oct 2010 01:32:33 +1100 From: "Aneesh Kumar K. V" To: Brad Boyer In-Reply-To: <20101023195957.GA13348@cynthia.pants.nu> References: <1287412853-24700-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1287412853-24700-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <20101023195957.GA13348@cynthia.pants.nu> User-Agent: Notmuch/0.3.1-90-g8071c5c (http://notmuchmail.org) Emacs/24.0.50.1 (i686-pc-linux-gnu) Date: Sun, 24 Oct 2010 20:02:32 +0530 Message-ID: MIME-Version: 1.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.2 AWL AWL: From: address is in the auto white-list X-Headers-End: 1PA1cq-0008An-OO Cc: linux-fsdevel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [V9fs-developer] [PATCH 2/2] net/9p: Return error on read with NULL buffer X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 24 Oct 2010 14:33:19 +0000 (UTC) diff --git a/net/9p/client.c b/net/9p/client.c index e141e46..dbca5b3 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1333,16 +1333,13 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset, if (data) { memmove(data, dataptr, count); - } - - if (udata) { + } else { err = copy_to_user(udata, dataptr, count); if (err) { err = -EFAULT; goto free_and_error; } } - p9_free_req(clnt, req); return count;