Skip to content

Commit 39d0d3b

Browse files
amschuma-ntaptrondmypd
authored andcommitted
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: Olga Kornievskaia <aglo@umich.edu> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent 8dbb095 commit 39d0d3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/nfs4trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ DECLARE_EVENT_CLASS(nfs4_open_event,
409409
__entry->flags = flags;
410410
__entry->fmode = (__force unsigned int)ctx->mode;
411411
__entry->dev = ctx->dentry->d_sb->s_dev;
412-
if (!IS_ERR(state))
412+
if (!IS_ERR_OR_NULL(state))
413413
inode = state->inode;
414414
if (inode != NULL) {
415415
__entry->fileid = NFS_FILEID(inode);

0 commit comments

Comments
 (0)