mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
nvme_fc: correct LS validation
LS validations shouldn't have been independent checks. Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
4083aa986f
commit
f77fc87c37
@ -848,11 +848,12 @@ nvme_fc_connect_admin_queue(struct nvme_fc_ctrl *ctrl,
|
||||
/* validate the ACC response */
|
||||
if (assoc_acc->hdr.w0.ls_cmd != FCNVME_LS_ACC)
|
||||
fcret = VERR_LSACC;
|
||||
if (assoc_acc->hdr.desc_list_len !=
|
||||
else if (assoc_acc->hdr.desc_list_len !=
|
||||
fcnvme_lsdesc_len(
|
||||
sizeof(struct fcnvme_ls_cr_assoc_acc)))
|
||||
fcret = VERR_CR_ASSOC_ACC_LEN;
|
||||
if (assoc_acc->hdr.rqst.desc_tag != cpu_to_be32(FCNVME_LSDESC_RQST))
|
||||
else if (assoc_acc->hdr.rqst.desc_tag !=
|
||||
cpu_to_be32(FCNVME_LSDESC_RQST))
|
||||
fcret = VERR_LSDESC_RQST;
|
||||
else if (assoc_acc->hdr.rqst.desc_len !=
|
||||
fcnvme_lsdesc_len(sizeof(struct fcnvme_lsdesc_rqst)))
|
||||
@ -955,10 +956,10 @@ nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,
|
||||
/* validate the ACC response */
|
||||
if (conn_acc->hdr.w0.ls_cmd != FCNVME_LS_ACC)
|
||||
fcret = VERR_LSACC;
|
||||
if (conn_acc->hdr.desc_list_len !=
|
||||
else if (conn_acc->hdr.desc_list_len !=
|
||||
fcnvme_lsdesc_len(sizeof(struct fcnvme_ls_cr_conn_acc)))
|
||||
fcret = VERR_CR_CONN_ACC_LEN;
|
||||
if (conn_acc->hdr.rqst.desc_tag != cpu_to_be32(FCNVME_LSDESC_RQST))
|
||||
else if (conn_acc->hdr.rqst.desc_tag != cpu_to_be32(FCNVME_LSDESC_RQST))
|
||||
fcret = VERR_LSDESC_RQST;
|
||||
else if (conn_acc->hdr.rqst.desc_len !=
|
||||
fcnvme_lsdesc_len(sizeof(struct fcnvme_lsdesc_rqst)))
|
||||
|
Loading…
Reference in New Issue
Block a user