diag: Add sanity check for data

DIAG driver communicates to peripherals over SMD channels. It parses
data read and then takes appropriate actions. Sometimes, SMD can pass
corrupted data and cause DIAG driver to crash. Adding checks around
data will prevent such crashes.

Change-Id: Ic82b1e31557eb432e57f3f6b152b22c1d3f5cd37
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
2 files changed