Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@oracle.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>

authored by

Dan Carpenter and committed by
Philipp Reisner
bf0d6e4a 1e39152f

+2 -2
+1 -1
drivers/block/drbd/drbd_receiver.c
··· 1592 1592 struct drbd_peer_request *peer_req; 1593 1593 struct page *page; 1594 1594 int dgs, ds, err; 1595 - int data_size = pi->size; 1595 + unsigned int data_size = pi->size; 1596 1596 void *dig_in = peer_device->connection->int_dig_in; 1597 1597 void *dig_vv = peer_device->connection->int_dig_vv; 1598 1598 unsigned long *data;
+1 -1
include/linux/drbd.h
··· 52 52 #endif 53 53 54 54 extern const char *drbd_buildtag(void); 55 - #define REL_VERSION "8.4.3" 55 + #define REL_VERSION "8.4.5" 56 56 #define API_VERSION 1 57 57 #define PRO_VERSION_MIN 86 58 58 #define PRO_VERSION_MAX 101