public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: jack@suse.cz
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] udf: in scan_anchors() sector_t last[] is unsigned and cannot be negative.
Date: Tue, 02 Dec 2008 23:10:17 +0100	[thread overview]
Message-ID: <4935B249.6020906@gmail.com> (raw)

sector_t last[] is unsigned and cannot be negative.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Maybe you can suggest a less ugly solution?

diff --git a/fs/udf/super.c b/fs/udf/super.c
index e25e701..d53c6fc 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -721,7 +721,7 @@ static sector_t udf_scan_anchors(struct super_block *sb, sector_t lastblock)
 	 *  however, if the disc isn't closed, it could be 512 */
 
 	for (i = 0; i < ARRAY_SIZE(last); i++) {
-		if (last[i] < 0)
+		if (last[i] > last[0] + 1)
 			continue;
 		if (last[i] >= sb->s_bdev->bd_inode->i_size >>
 				sb->s_blocksize_bits)


             reply	other threads:[~2008-12-02 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 22:10 Roel Kluin [this message]
2008-12-03 16:40 ` [PATCH] udf: in scan_anchors() sector_t last[] is unsigned and cannot be negative Jan Kara

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=4935B249.6020906@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=jack@suse.cz \
    --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