motor: tspdrv: Check buffer size before copying

Update from VPUDND8

Change-Id: If7a57f15151074b1d984b51255257116121e5682
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
motor: tspdrv: return on invalid buffer index

Update from VPUDND8

Change-Id: I941042c68d89ed636d8be9f2f54bcc1c20f930a8
Signed-off-by: Luis Cruz <ljc2491@gmail.com>