ARM: OMAP2: possible division by 0
authorRoel Kluin <roel.kluin@gmail.com>
Wed, 15 Apr 2009 17:44:52 +0000 (10:44 -0700)
committerTony Lindgren <tony@atomide.com>
Wed, 15 Apr 2009 17:44:52 +0000 (10:44 -0700)
commitc094ba34b8f780885d029ce3c2715a194b780e5d
treee14065583ab7fad93bb3c428515d6d208e465153
parentdeda194b959968c16464975edee7dda54ddc8505
ARM: OMAP2: possible division by 0

In linus' git tree the functions can be found at:
vi arch/arm/mach-omap2/usb-tusb6010.c +200 - tusb6010_platform_retime()
vi arch/arm/mach-omap2/gpmc.c +94 - gpmc_get_fclk_period()
vi arch/arm/mach-omap2/usb-tusb6010.c +53 - tusb_set_async_mode()
vi arch/arm/mach-omap2/usb-tusb6010.c +111 - tusb_set_sync_mode()

is -ENODEV appropriate when sysclk_ps == 0?

This was found by code analysis, please review.
------------------------------>8-------------8<---------------------------------
gpmc_get_fclk_period() may return 0 when gpmc_l3_clk is not enabled. This is
not checked in tusb6010_platform_retime() nor in tusb_set_async_mode() it
seems. In tusb_set_sync_mode() this may result in a division by zero.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/usb-tusb6010.c