drivers: sensors: lsm6dsl: Fix array overrun
drivers: sensors: lsm6dsl: Fix array overrun

This patch fixes an overrun detected via Coverity.  The
lsm6dsl_odr_to_freq_val function takes an index as argument.  If the
index is out of bounds, the expected behavior was to return the last
element of an array.  The actual behavior was to overrun the array.

Fixes: #7482

Signed-off-by: Andy Gross <4ba87047449f5700e8758e3b1af36e94376c2fff@linaro.org>

punitvara/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,explora26/zephyr,mbolivar/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,kraj/zephyr,galak/zephyr,galak/zephyr,zephyriot/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,kraj/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,mbolivar/zephyr,kraj/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,zephyriot/zephyr,zephyriot/zephyr,mbolivar/zephyr,zephyriot/zephyr,ldts/zephyr,punitvara/zephyr,kraj/zephyr,ldts/zephyr,nashif/zephyr,zephyriot/zephyr,nashif/zephyr,Vudentz/zephyr,finikorg/zephyr,finikorg/zephyr,kraj/zephyr,Vudentz/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,ldts/zephyr,Vudentz/zephyr,Vudentz/zephyr,punitvara/zephyr,mbolivar/zephyr,Vudentz/zephyr,ldts/zephyr,mbolivar/zephyr,ldts/zephyr,galak/zephyr,nashif/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,finikorg/zephyr,punitvara/zephyr,nashif/zephyr