]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: aspeed: fix invalid clock parameters for very large divisors
authorBrendan Higgins <brendanhiggins@google.com>
Fri, 21 Sep 2018 23:30:50 +0000 (16:30 -0700)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 24 Sep 2018 21:50:42 +0000 (23:50 +0200)
commita0381ee893d9edfd11648b95fbcfb20e091dbae3
tree1b8c338ce114a386b8ae0277603631752f850088
parentdfb4d5124585de9c136cc9076f41402e43a63947
i2c: aspeed: fix invalid clock parameters for very large divisors

The function that computes clock parameters from divisors did not
respect the maximum size of the bitfields that the parameters were
written to. This fixes the bug.

This bug can be reproduced with (and this fix verified with) the test
at: https://kunit-review.googlesource.com/c/linux/+/1035/

Discovered-by-KUnit: https://kunit-review.googlesource.com/c/linux/+/1035/
Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Reviewed-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-aspeed.c