Skip to content

Commit

Permalink
[CIFS] Fix oops in cifs_readpages caused by not checking buf_type in an
Browse files Browse the repository at this point in the history
error path of new cifs_readpages code.

Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Steve French committed Jan 18, 2006
1 parent d65177c commit 47c886b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,10 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,

/* need to free smb_read_data buf before exit */
if (smb_read_data) {
cifs_buf_release(smb_read_data);
if(buf_type == CIFS_SMALL_BUFFER)
cifs_small_buf_release(smb_read_data);
else if(buf_type == CIFS_LARGE_BUFFER)
cifs_buf_release(smb_read_data);
smb_read_data = NULL;
}

Expand Down

0 comments on commit 47c886b

Please sign in to comment.