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

Commit f50eb921 authored by Mohit Aggarwal's avatar Mohit Aggarwal Committed by Gerrit - the friendly Code Review server
Browse files

diag: Add proper check for peripheral value



Currently, due to improper check for peripheral
value, wrong index of diag feature array might
be accessed. The patch fixes the issue by adding
correct check.

Change-Id: I274f08889a9bc99763e6a57cc51172e20488c0cf
Signed-off-by: default avatarMohit Aggarwal <maggarwa@codeaurora.org>
parent 06e26fc3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1229,7 +1229,7 @@ void diag_real_time_work_fn(struct work_struct *work)
		if (peripheral > NUM_PERIPHERALS)
			peripheral = diag_search_peripheral_by_pd(i);

		if (peripheral < 0 || peripheral > NUM_PERIPHERALS)
		if (peripheral < 0 || peripheral >= NUM_PERIPHERALS)
			continue;

		if (!driver->feature[peripheral].peripheral_buffering)