drivers: can: nrf: fix invalid pointer leading to undef behavior
The can_nrf device driver incorrectly passes its own device driver pointer to a call to clock_control_get_rate() to get the rate of the auxpll. The actual device driver which should be passed to clock_control_get_rate() is the auxpll. Without this fix, the call jumps to the can_nrf_api and returns garbage (unfortunately it does not hardfault, which is why this issue has not been discovered yet). Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
This commit is contained in:
parent
5d390b4817
commit
f5ee52ecf3
@ -147,7 +147,7 @@ static int configure_hsfll(const struct device *dev, bool on)
|
||||
if (on) {
|
||||
int ret;
|
||||
|
||||
ret = clock_control_get_rate(dev, NULL, &spec.frequency);
|
||||
ret = clock_control_get_rate(config->auxpll, NULL, &spec.frequency);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user