From: Jun Piao Date: Tue, 15 Mar 2016 21:53:23 +0000 (-0700) Subject: ocfs2/dlm: fix a variable overflow problem in dlmdomain.c X-Git-Tag: v4.9.8~2522^2~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d67d3c2444fd3bb787cc6c27053717c01155966;p=platform%2Fkernel%2Flinux-rpi3.git ocfs2/dlm: fix a variable overflow problem in dlmdomain.c In dlm_send_join_cancels(), node is defined with type unsigned int, but initialized with -1, this will lead variable overflow. Although this won't cause any runtime problem, the code looks a little uncoordinated. Signed-off-by: Jun Piao Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index c73c68e..12e064b 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c @@ -1399,7 +1399,7 @@ static int dlm_send_join_cancels(struct dlm_ctxt *dlm, unsigned int map_size) { int status, tmpstat; - unsigned int node; + int node; if (map_size != (BITS_TO_LONGS(O2NM_MAX_NODES) * sizeof(unsigned long))) {