From: Alex Elder Date: Thu, 10 Jan 2013 18:56:58 +0000 (-0600) Subject: rbd: check for overflow in rbd_get_num_segments() X-Git-Tag: v3.9-rc1~41^2~21^2~59^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38901e0f240b634467fb31743365af80a006be33;p=pandora-kernel.git rbd: check for overflow in rbd_get_num_segments() The return type of rbd_get_num_segments() is int, but the values it operates on are u64. Although it's not likely, there's no guarantee the result won't exceed what can be respresented in an int. The function is already designed to return -ERANGE on error, so just add this possible overflow as another reason to return that. Signed-off-by: Alex Elder Reviewed-by: Dan Mick Reviewed-by: Josh Durgin --- Reading git-diff-tree failed