The only known LCM algorithm is factoring number. Look at lib/lcm.c, evaluation of 'a / gcd(a, b) * b' does error: example a = 2, b = 4, 2 / 2 * 4 = 4 where the LCM(2, 4) equal to 2. Let delete misimplemented junk from kernel sources.