]> 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>
Fri, 14 Sep 2012 07:05:40 +0000 (17:05 +1000)
commit8960faa52c582d446f792c740dbe6f1a868b90ce
tree56a8b8268d8a1d44aa05a60503c7f39c03d72cb4
parent125ddf914c491c913243a287743f40dfe5ca2121
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