Skip to contentSkip to conversation

fs: 9p: fix wrong pointer passed to IS_ERR() and PTR_ERR()

PATCH Superseded Yang Yingliang 2 participants 2 messages Mar 30, 2021 9P file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: 9p: fix wrong pointer passed to IS_ERR() and PTR_ERR()

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")
---
 fs/9p/vfs_file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/9p/vfs_file.c +2 -2
index 649f04f112dc..59c32c9b799f 100644
@@ -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;
 		}
Signature · 1 line
2.25.1
#1 lore raw

Yang Yingliang wrote on Tue, Mar 30, 2021 at 09:06:32PM +0800:

Quoted 2 lines

IS_ERR() and PTR_ERR() use wrong pointer, it should be writeback_fid, fix it.

Right.

Good catch, thanks

Signature · 1 line
Dominique