diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 7e735724940f7fc2dccc83ce596957b54cabe0c1..2d13f636de93c73e2cdef67111b099191106ad93 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1773,10 +1773,9 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
  */
 unsigned int io_file_get_flags(struct file *file)
 {
-	umode_t mode = file_inode(file)->i_mode;
 	unsigned int res = 0;
 
-	if (S_ISREG(mode))
+	if (S_ISREG(file_inode(file)->i_mode))
 		res |= FFS_ISREG;
 	if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))
 		res |= FFS_NOWAIT;