]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
lib/gcd.c: prevent possible div by 0
authorDavidlohr Bueso <dave@gnu.org>
Thu, 13 Sep 2012 01:01:12 +0000 (11:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Sep 2012 07:28:09 +0000 (17:28 +1000)
commit2a184fe115dcb5c5283639aefa87ce5327727493
tree6ad5c7b326d0ce60c6cc4ecb52d65fa5f82d2fb0
parent1b4cadb73d90de995e128ba14c8c84ba4a685684
lib/gcd.c: prevent possible div by 0

Account for all properties when a and/or b are 0:
gcd(0, 0) = 0
gcd(a, 0) = a
gcd(0, b) = b

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/gcd.c