Bluetooth: host: Avoid using out-of-scope pointer
Bluetooth: host: Avoid using out-of-scope pointer

Mkae sure that variable pointed by params is valid when passing it
as function argument.

Fixes #10587

Signed-off-by: Szymon Janc <db186c297188f7acbbdc9bbd6aff2f45665bb42d@codecoup.pl>

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