summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-02-15 20:13:52 +0000
committerSteve French <sfrench@us.ibm.com>2006-02-15 20:13:52 +0000
commit27754b34600770beb38e3ae12cb3f345f02e3797 (patch)
tree0a50ad43c1114b40bda056bae13e0b9dd7e4eeb9 /fs/cifs
parent0ed3f64ec3a7ad29e83e03607115eeffa32f553c (diff)
parent5ecfbae093f0c37311e89b29bfc0c9d586eace87 (diff)
downloadblackbird-op-linux-27754b34600770beb38e3ae12cb3f345f02e3797.tar.gz
blackbird-op-linux-27754b34600770beb38e3ae12cb3f345f02e3797.zip
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/file.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index d17c97d07c80..675bd2568297 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1442,13 +1442,15 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
&bytes_read, &smb_read_data,
&buf_type);
pSMBr = (struct smb_com_read_rsp *)smb_read_data;
- if (copy_to_user(current_offset,
- smb_read_data + 4 /* RFC1001 hdr */
- + le16_to_cpu(pSMBr->DataOffset),
- bytes_read)) {
- rc = -EFAULT;
- }
if (smb_read_data) {
+ if (copy_to_user(current_offset,
+ smb_read_data +
+ 4 /* RFC1001 length field */ +
+ le16_to_cpu(pSMBr->DataOffset),
+ bytes_read)) {
+ rc = -EFAULT;
+ }
+
if(buf_type == CIFS_SMALL_BUFFER)
cifs_small_buf_release(smb_read_data);
else if(buf_type == CIFS_LARGE_BUFFER)
OpenPOWER on IntegriCloud