From e2692c7447ca83ccce6fde9c790f70410593af60 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 18 Oct 2018 12:51:52 +0300 Subject: [PATCH] extra: prevent a divide by zero I don't know what this code is about. It obviously just divides by zero which is wrong. It only crashes on code with obvious divide by zero bugs so it doesn't affect the normal kernel... Anyway, I have deleted it. Signed-off-by: Dan Carpenter --- smatch_extra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smatch_extra.c b/smatch_extra.c index 9d3d331e..d611b9b7 100644 --- a/smatch_extra.c +++ b/smatch_extra.c @@ -1614,7 +1614,7 @@ static void move_known_values(struct expression **left_p, struct expression **ri if (!get_value(right->right, &divisor)) return; - if (divisor.value == 0 && sval.value % divisor.value) + if (divisor.value == 0) return; *left_p = binop_expression(left, invert_op(right->op), right->right); *right_p = right->left; @@ -1642,7 +1642,7 @@ static void move_known_values(struct expression **left_p, struct expression **ri if (!get_value(left->right, &divisor)) return; - if (divisor.value == 0 && sval.value % divisor.value) + if (divisor.value == 0) return; *right_p = binop_expression(right, invert_op(left->op), left->right); *left_p = left->left; -- 2.11.4.GIT