* [PATCH -next] fs: 9p: fix wrong pointer passed to IS_ERR() and PTR_ERR()
@ 2021-03-30 13:06 Yang Yingliang
2021-03-30 21:52 ` asmadeus
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2021-03-30 13:06 UTC (permalink / raw)
To: linux-kernel, v9fs-developer; +Cc: asmadeus
IS_ERR() and PTR_ERR() use wrong pointer, it should be
writeback_fid, fix it.
Fixes: 5bfe97d7382b ("9p: Fix writeback fid incorrectly being attached to dentry")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
fs/9p/vfs_file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 649f04f112dc..59c32c9b799f 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -86,8 +86,8 @@ int v9fs_file_open(struct inode *inode, struct file *file)
* to work.
*/
writeback_fid = v9fs_writeback_fid(file_dentry(file));
- if (IS_ERR(fid)) {
- err = PTR_ERR(fid);
+ if (IS_ERR(writeback_fid)) {
+ err = PTR_ERR(writeback_fid);
mutex_unlock(&v9inode->v_mutex);
goto out_error;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] fs: 9p: fix wrong pointer passed to IS_ERR() and PTR_ERR()
2021-03-30 13:06 [PATCH -next] fs: 9p: fix wrong pointer passed to IS_ERR() and PTR_ERR() Yang Yingliang
@ 2021-03-30 21:52 ` asmadeus
0 siblings, 0 replies; 2+ messages in thread
From: asmadeus @ 2021-03-30 21:52 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, v9fs-developer
Yang Yingliang wrote on Tue, Mar 30, 2021 at 09:06:32PM +0800:
> IS_ERR() and PTR_ERR() use wrong pointer, it should be
> writeback_fid, fix it.
Right.
Good catch, thanks
--
Dominique
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-30 21:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 13:06 [PATCH -next] fs: 9p: fix wrong pointer passed to IS_ERR() and PTR_ERR() Yang Yingliang
2021-03-30 21:52 ` asmadeus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).