Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoiding unnecessary calculating of 1<<-1 in case of reset_idx == -1 the value -1, is a valid and used value for reset_idx ``` 1.006965] UBSAN: shift-out-of-bounds in drivers/clk/clk-aspeed.c:214:12 [ 1.007271] shift exponent -1 is negative [ 1.007412] CPU: 0 PID: 1 Comm: swapper Not tainted 6.6.58-345bcb4-19272-g345bcb402a84 openbmc#1 [ 1.007563] Hardware name: Generic DT based system [ 1.007749] unwind_backtrace from show_stack+0x10/0x14 [ 1.008434] show_stack from dump_stack_lvl+0x24/0x2c [ 1.008479] dump_stack_lvl from ubsan_epilogue+0x8/0x34 [ 1.008518] ubsan_epilogue from __ubsan_handle_shift_out_of_bounds+0xe0/0x110 [ 1.008559] __ubsan_handle_shift_out_of_bounds from aspeed_clk_enable+0x44/0x124 [ 1.008600] aspeed_clk_enable from clk_core_enable+0x80/0xec [ 1.008634] clk_core_enable from clk_core_enable_lock+0x18/0x2c [ 1.008668] clk_core_enable_lock from __clk_register+0x594/0x6ac [ 1.008705] __clk_register from clk_hw_register+0x30/0x3c [ 1.008741] clk_hw_register from aspeed_clk_probe+0x5fc/0x6b4 [ 1.008776] aspeed_clk_probe from platform_probe+0x58/0xc0 [ 1.008813] platform_probe from really_probe+0x1b0/0x3d0 [ 1.008848] really_probe from __driver_probe_device+0x1c0/0x1f8 [ 1.008882] __driver_probe_device from driver_probe_device+0x2c/0xc4 [ 1.008916] driver_probe_device from __driver_attach+0x148/0x16c [ 1.008950] __driver_attach from bus_for_each_dev+0x78/0xb8 [ 1.008989] bus_for_each_dev from bus_add_driver+0xf8/0x220 [ 1.009027] bus_add_driver from driver_register+0xb8/0x100 [ 1.009060] driver_register from do_one_initcall+0x70/0x224 [ 1.009095] do_one_initcall from kernel_init_freeable+0x1e8/0x238 [ 1.009136] kernel_init_freeable from kernel_init+0x14/0x108 [ 1.009171] kernel_init from ret_from_fork+0x14/0x28 [ 1.009256] Exception stack(0xbc815fb0 to 0xbc815ff8) ``` Signed-off-by: Ben Peled <bpeled@nvidia.com>
- Loading branch information