]> git.karo-electronics.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>
Mon, 17 Sep 2012 10:46:10 +0000 (20:46 +1000)
commit09e481e31a7df108d0313a2374e4bd0d7141ced5
treeab0774603ecd4084228a0ad160ea04cdcf83a37a
parent2e63792b657daab6b1b2da958326aa268a60c3a0
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