Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77970693 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French
Browse files

cifs: check for private_data before trying to put it



cifs_close doesn't check that the filp->private_data is non-NULL before
trying to put it. That can cause an oops in certain error conditions
that can occur on open or lookup before the private_data is set.

Reported-by: default avatarBen Greear <greearb@candelatech.com>
CC: Stable <stable@kernel.org>
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent a6360dd3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -575,8 +575,10 @@ reopen_error_exit:

int cifs_close(struct inode *inode, struct file *file)
{
	if (file->private_data != NULL) {
		cifsFileInfo_put(file->private_data);
		file->private_data = NULL;
	}

	/* return code from the ->release op is always ignored */
	return 0;