ocfs2/dlm: fix a variable overflow problem in dlmdomain.c
PATCH v2 1/1 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 <[email protected]>
--- dlm/dlmdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
dlm/dlmdomain.c +1 -1
@@ -1396,7 +1396,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 ))) {
Signature · 1 line
1.8.4.3
PATCH v2 1/1 ocfs2/dlm: fix a variable overflow problem in dlmdomain.c
Quoted 5 lines · piaojun
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 <[email protected]>
Thanks, Jun.
Reviewed-by Joseph Qi <[email protected]>
Quoted 18 lines
--- dlm/dlmdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)dlm/dlmdomain.c +1
-1@@ -1396,7 +1396,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 ))) {