[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20140506112832.GA25561@mwanda>
Date: Tue, 6 May 2014 14:28:32 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Lars Ellenberg <drbd-dev@...ts.linbit.com>
Cc: drbd-user@...ts.linbit.com, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] drbd: silence underflow warning in read_in_block()
My static checker warns that "data_size" could be negative and underflow
the limit check. The code looks suspicious but I don't know if it is a
real bug.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index b6c8aaf..15daf86d 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1528,7 +1528,7 @@ read_in_block(struct drbd_peer_device *peer_device, u64 id, sector_t sector,
struct drbd_peer_request *peer_req;
struct page *page;
int dgs, ds, err;
- int data_size = pi->size;
+ unsigned int data_size = pi->size;
void *dig_in = peer_device->connection->int_dig_in;
void *dig_vv = peer_device->connection->int_dig_vv;
unsigned long *data;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists