public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: roel kluin <roel.kluin@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] ROMFS: romfs_iget() - unsigned ino >= 0 is always true
Date: Sat, 29 Nov 2008 11:25:57 -0500	[thread overview]
Message-ID: <49316D15.4070703@gmail.com> (raw)

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
for romfs_strnlen(), see
vi fs/romfs/inode.c +200

diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c
index 60d2f82..28b180b 100644
--- a/fs/romfs/inode.c
+++ b/fs/romfs/inode.c
@@ -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;
 
@@ -527,9 +527,9 @@ romfs_iget(struct super_block *sb, unsigned long ino)
 	i->i_uid = i->i_gid = 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;
 


                 reply	other threads:[~2008-11-29 16:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49316D15.4070703@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox