From patchwork Wed Oct 27 04:11:01 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: 284592 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 o9R4Bk5U016340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 27 Oct 2010 04:12:07 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PAxMI-0000hz-Jv; Wed, 27 Oct 2010 04:11:30 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PAxMH-0000ht-9O for v9fs-developer@lists.sourceforge.net; Wed, 27 Oct 2010 04:11:29 +0000 X-ACL-Warn: Received: from e23smtp08.au.ibm.com ([202.81.31.141]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1PAxME-0006yN-In for v9fs-developer@lists.sourceforge.net; Wed, 27 Oct 2010 04:11:29 +0000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp08.au.ibm.com (8.14.4/8.13.1) with ESMTP id o9R4Blfi007953 for ; Wed, 27 Oct 2010 15:11:47 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9R4B5GQ2330846 for ; Wed, 27 Oct 2010 15:11:05 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9R4B5qk016706 for ; Wed, 27 Oct 2010 15:11:05 +1100 Received: from skywalker.in.ibm.com ([9.77.203.44]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o9R4B3Za016670; Wed, 27 Oct 2010 15:11:04 +1100 From: "Aneesh Kumar K.V" To: v9fs-developer@lists.sourceforge.net Date: Wed, 27 Oct 2010 09:41:01 +0530 Message-Id: <1288152661-21684-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 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: 1PAxME-0006yN-In Subject: [V9fs-developer] [PATCH -V2] 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: , MIME-Version: 1.0 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]); Wed, 27 Oct 2010 04:12:07 +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;