From: Trond Myklebust Date: Mon, 19 Dec 2005 22:11:25 +0000 (-0500) Subject: NLM: Fix Oops in nlmclnt_mark_reclaim() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9b5b1f5bf9dcdb6f23abf65977a675eb4deba3c0;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git NLM: Fix Oops in nlmclnt_mark_reclaim() When mixing -olock and -onolock mounts on the same client, we have to check that fl->fl_u.nfs_fl.owner is set before dereferencing it. Signed-off-by: Trond Myklebust --- diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index 006bb9e1457..3eaf6e70108 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c @@ -157,6 +157,8 @@ void nlmclnt_mark_reclaim(struct nlm_host *host) inode = fl->fl_file->f_dentry->d_inode; if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) continue; + if (fl->fl_u.nfs_fl.owner == NULL) + continue; if (fl->fl_u.nfs_fl.owner->host != host) continue; if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED)) @@ -226,6 +228,8 @@ restart: inode = fl->fl_file->f_dentry->d_inode; if (inode->i_sb->s_magic != NFS_SUPER_MAGIC) continue; + if (fl->fl_u.nfs_fl.owner == NULL) + continue; if (fl->fl_u.nfs_fl.owner->host != host) continue; if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_RECLAIM))