提交 0bf8264e 编写于 作者: M Markus Armbruster 提交者: Paolo Bonzini

scsi: Drop useless null test in scsi_unit_attention()

req was created by scsi_req_alloc(), which initializes req->dev to a
value it dereferences.  req->dev isn't changed anywhere else.
Therefore, req->dev can't be null.

Drop the useless null test; it spooks Coverity.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
上级 032f0101
......@@ -282,7 +282,7 @@ static const struct SCSIReqOps reqops_invalid_opcode = {
static int32_t scsi_unit_attention(SCSIRequest *req, uint8_t *buf)
{
if (req->dev && req->dev->unit_attention.key == UNIT_ATTENTION) {
if (req->dev->unit_attention.key == UNIT_ATTENTION) {
scsi_req_build_sense(req, req->dev->unit_attention);
} else if (req->bus->unit_attention.key == UNIT_ATTENTION) {
scsi_req_build_sense(req, req->bus->unit_attention);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册