diag: Validate peripheral received from user for switch logging

Currently check is missing for peripheral sent by user for
switch logging, due to this there is a possibility of out-of-bound
read. The patch adds proper check for peripheral and protection
before accessing global variable md_session_map.

Change-Id: I165b9a7900cec20ca7970b37ca4823e2186fe27c
Signed-off-by: Hardik Arya <harya@codeaurora.org>
1 file changed