From: Bobi Jam Date: Thu, 3 Nov 2016 01:25:00 +0000 (-0400) Subject: staging/lustre/llite: protect from accessing NULL lli_clob X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=028f78a9b83534f18ee7383cfad0052aa0de47a1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging/lustre/llite: protect from accessing NULL lli_clob Need to check file's lli_clob object before calling lov_read_and_clear_async_rc(). Signed-off-by: Bobi Jam Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/23031 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8682 Signed-off-by: Oleg Drokin Reviewed-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index c1c7551991e6..7886840328d0 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -2328,9 +2328,11 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync) lli->lli_async_rc = 0; if (rc == 0) rc = err; - err = lov_read_and_clear_async_rc(lli->lli_clob); - if (rc == 0) - rc = err; + if (lli->lli_clob) { + err = lov_read_and_clear_async_rc(lli->lli_clob); + if (rc == 0) + rc = err; + } } err = md_sync(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), &req);