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

Commit b37566db authored by Kiran Gunda's avatar Kiran Gunda
Browse files

leds: qpnp-flash-v2: Fix out-of-bound array access



Fix out-of-bound array access by using the right
offset-mask in getting the OTST status.

Change-Id: I89a4176251ea9157c5dd997b3c11bfcb07420a4f
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent 3e61c1d8
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@


#define	FLASH_LED_REG_LED_STATUS2(base)		(base + 0x09)
#define	FLASH_LED_REG_LED_STATUS2(base)		(base + 0x09)
#define	FLASH_LED_VPH_DROOP_FAULT_MASK		BIT(4)
#define	FLASH_LED_VPH_DROOP_FAULT_MASK		BIT(4)
#define	FLASH_LED_THERMAL_OTST_MASK		GENMASK(2, 0)


#define	FLASH_LED_REG_INT_RT_STS(base)		(base + 0x10)
#define	FLASH_LED_REG_INT_RT_STS(base)		(base + 0x10)


@@ -1201,6 +1202,7 @@ static int qpnp_flash_led_calc_thermal_current_lim(struct qpnp_flash_led *led,
	if (rc < 0)
	if (rc < 0)
		return rc;
		return rc;


	otst_status &= FLASH_LED_THERMAL_OTST_MASK;
	/* Look up current limit based on THERMAL_OTST status */
	/* Look up current limit based on THERMAL_OTST status */
	if (otst_status)
	if (otst_status)
		*thermal_current_lim =
		*thermal_current_lim =