]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
ARM: OMAP2: possible division by 0
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 7 Apr 2009 22:27:08 +0000 (15:27 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 7 Apr 2009 22:27:08 +0000 (15:27 -0700)
commite7aa1abdaf070f144ac11352ea9b6b2da91dac38
tree775a78d04240c5a1d1569c5a5e22c2b82172c4e7
parent7e7b5bb2c424812d5d8220eaf7e0eadddefc8e64
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