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

Commit d75aa40c authored by Sreelakshmi Gownipalli's avatar Sreelakshmi Gownipalli Committed by Gerrit - the friendly Code Review server
Browse files

diag: Check for the peripheral limits for the pd



Check for the perpheral limits while fetching peripheral information
from the pd before sending the non real time mode control packet
to the peripheral.

Change-Id: Iad8b2d12f8f8e83342bf299cb43b5e5dbb12c608
Signed-off-by: default avatarSreelakshmi Gownipalli <sgownipa@codeaurora.org>
parent f5f31790
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -1131,6 +1131,9 @@ 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)
			continue;

		if (!driver->feature[peripheral].peripheral_buffering)
			continue;
		switch (driver->buffering_mode[i].mode) {