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

Commit 441a08db authored by Tejas Prajapati's avatar Tejas Prajapati
Browse files

msm: camera: isp: variable should be accessed only if match is found



There is a possibility that the priority variable would
be accessed even for the HEAD node which would result in
out of bound errors, so access the elements of the
structure only if the handler is found.

Change-Id: I09dc527b1ff878604bf157e106bb3e5805a7e516
Signed-off-by: default avatarTejas Prajapati <tpraja@codeaurora.org>
parent 575b31a5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -511,8 +511,8 @@ int cam_irq_controller_unsubscribe_irq(void *irq_controller,
		}
	}

	priority = evt_handler->priority;
	if (found) {
		priority = evt_handler->priority;
		for (i = 0; i < controller->num_registers; i++) {
			irq_register = &controller->irq_register_arr[i];
			irq_register->top_half_enable_mask[priority] &=
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -511,8 +511,8 @@ int cam_irq_controller_unsubscribe_irq(void *irq_controller,
		}
	}

	priority = evt_handler->priority;
	if (found) {
		priority = evt_handler->priority;
		for (i = 0; i < controller->num_registers; i++) {
			irq_register = &controller->irq_register_arr[i];
			irq_register->top_half_enable_mask[priority] &=