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

Commit 39d0d3bd authored by Anna Schumaker's avatar Anna Schumaker Committed by Trond Myklebust
Browse files

NFS: Fix a tracepoint NULL-pointer dereference



Running xfstest generic/013 with the tracepoint nfs:nfs4_open_file
enabled produces a NULL-pointer dereference when calculating fileid and
filehandle of the opened file.  Fix this by checking if state is NULL
before trying to use the inode pointer.

Reported-by: default avatarOlga Kornievskaia <aglo@umich.edu>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 8dbb0957
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -409,7 +409,7 @@ DECLARE_EVENT_CLASS(nfs4_open_event,
			__entry->flags = flags;
			__entry->flags = flags;
			__entry->fmode = (__force unsigned int)ctx->mode;
			__entry->fmode = (__force unsigned int)ctx->mode;
			__entry->dev = ctx->dentry->d_sb->s_dev;
			__entry->dev = ctx->dentry->d_sb->s_dev;
			if (!IS_ERR(state))
			if (!IS_ERR_OR_NULL(state))
				inode = state->inode;
				inode = state->inode;
			if (inode != NULL) {
			if (inode != NULL) {
				__entry->fileid = NFS_FILEID(inode);
				__entry->fileid = NFS_FILEID(inode);