]> git.proxmox.com Git - mirror_ubuntu-focal-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)
commit17ccba67109cd0631f206cf49e17986218b47854
tree1b8c338ce114a386b8ae0277603631752f850088
parentf8878fadba1e8cfcaadf98d437040d3fe9e2d12c
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