Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1565962 authored by roel kluin's avatar roel kluin Committed by Linus Torvalds
Browse files

romfs: romfs_iget() - unsigned ino >= 0 is always true



romfs_strnlen() returns int
unsigned X >= 0 is always true

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: default avatarroel kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 921d58c0
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ static mode_t romfs_modemap[] =
static struct inode *
romfs_iget(struct super_block *sb, unsigned long ino)
{
	int nextfh;
	int nextfh, ret;
	struct romfs_inode ri;
	struct inode *i;

@@ -526,9 +526,9 @@ romfs_iget(struct super_block *sb, unsigned long ino)
	i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0;

        /* Precalculate the data offset */
        ino = romfs_strnlen(i, ino+ROMFH_SIZE, ROMFS_MAXFN);
        if (ino >= 0)
                ino = ((ROMFH_SIZE+ino+1+ROMFH_PAD)&ROMFH_MASK);
	ret = romfs_strnlen(i, ino + ROMFH_SIZE, ROMFS_MAXFN);
	if (ret >= 0)
		ino = (ROMFH_SIZE + ret + 1 + ROMFH_PAD) & ROMFH_MASK;
	else
		ino = 0;