diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-10-19 09:17:02 +0530 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-10-28 09:08:49 -0500 |
commit | 7b3bb3fe166702b504f1068359c9550d3b277eaf (patch) | |
tree | 8a3c8039f55126dbafb23a06d7b03a1e5abf3d24 /net/9p/protocol.c | |
parent | 877cb3d4dd73838adcc6b79f2a3d29b155e7ebbe (diff) |
net/9p: Return error if we fail to encode protocol data
We need to return error in case we fail to encode data in protocol buffer.
This patch also return error in case of a failed copy_from_user.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/protocol.c')
-rw-r--r-- | net/9p/protocol.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 3acd3afb20c..45c15f49140 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c @@ -122,9 +122,8 @@ static size_t pdu_write_u(struct p9_fcall *pdu, const char __user *udata, size_t size) { size_t len = MIN(pdu->capacity - pdu->size, size); - int err = copy_from_user(&pdu->sdata[pdu->size], udata, len); - if (err) - printk(KERN_WARNING "pdu_write_u returning: %d\n", err); + if (copy_from_user(&pdu->sdata[pdu->size], udata, len)) + len = 0; pdu->size += len; return size - len; |