This is a note to let you know that I've just added the patch titled
lib/gcd.c: prevent possible div by 0
to the 3.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
lib-gcd.c-prevent-possible-div-by-0.patch
and it can be found in the queue-3.6 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From e96875677fb2b7cb739c5d7769824dff7260d31d Mon Sep 17 00:00:00 2001
From: Davidlohr Bueso <[email protected]>
Date: Thu, 4 Oct 2012 17:13:18 -0700
Subject: lib/gcd.c: prevent possible div by 0
From: Davidlohr Bueso <[email protected]>
commit e96875677fb2b7cb739c5d7769824dff7260d31d upstream.
Account for all properties when a and/or b are 0:
gcd(0, 0) = 0
gcd(a, 0) = a
gcd(0, b) = b
Fixes no known problems in current kernels.
Signed-off-by: Davidlohr Bueso <[email protected]>
Cc: Eric Dumazet <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
lib/gcd.c | 3 +++
1 file changed, 3 insertions(+)
--- a/lib/gcd.c
+++ b/lib/gcd.c
@@ -9,6 +9,9 @@ unsigned long gcd(unsigned long a, unsig
if (a < b)
swap(a, b);
+
+ if (!b)
+ return a;
while ((r = a % b) != 0) {
a = b;
b = r;
Patches currently in stable-queue which might be from [email protected] are
queue-3.6/lib-gcd.c-prevent-possible-div-by-0.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html