Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2675d2ab authored by Ashay Jaiswal's avatar Ashay Jaiswal
Browse files

gpio: qpnp-pin: Fix out of bound shift



UBSAN: Undefined behaviour in drivers/gpio/qpnp-pin.c:664:6
shift exponent -1 is negative
Call trace:
[<ffffffc00008ad5c>] dump_backtrace+0x0/0x1a4
[<ffffffc00008af10>] show_stack+0x10/0x1c
[<ffffffc00142ed60>] dump_stack+0x7c/0xe8
[<ffffffc0005282d0>] ubsan_epilogue+0x10/0x54
[<ffffffc000528cec>] __ubsan_handle_shift_out_of_bounds+0x12c/0x160
[<ffffffc000545b78>] _qpnp_pin_config+0x65c/0x920
[<ffffffc000546b00>] qpnp_pin_probe+0xb14/0xc44

Add check for valid dtest-line before configuring the gpio.

CRs-Fixed: 981729
Change-Id: I26c6edcd26da9cfbbf2859bf9d93477f5cb1b4f5
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent a8371783
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment