Add nil pointer check for InSDBBuffer

- Gotgt was crashing for few opcodes (sg_inq (sg3-utils)) because InSDBBuffer
  was not initialized for such opcodes (Need help)

Signed-off-by: Utkarsh Mani Tripathi <utkarsh.tripathi@mayadata.io>
This commit is contained in:
Utkarsh Mani Tripathi
2019-11-18 15:56:34 +05:30
parent 1dbc82435f
commit e5339f347a
3 changed files with 52 additions and 18 deletions

View File

@@ -96,7 +96,7 @@ func (s *SCSITargetService) AddCommandQueue(tid int, scmd *api.SCSICommand) erro
result := scmd.Device.PerformCommand(tid, scmd)
if result != api.SAMStatGood {
scmd.Result = result.Stat
log.Warnf("%v", result.Err)
log.Warnf("opcode: %xh err: %v", scmd.OpCode, result.Err)
}
return nil
}