Skip to content

Commit

Permalink
nvmet: avoid dereferencing nvmet_req
Browse files Browse the repository at this point in the history
No need to dereference req twice to get the cmd when we already
have it stored in a local variable.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Max Gurtovoy authored and Jens Axboe committed Feb 22, 2017
1 parent 8432bdb commit 2dbf581
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/target/fabrics-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int nvmet_parse_connect_cmd(struct nvmet_req *req)

req->ns = NULL;

if (req->cmd->common.opcode != nvme_fabrics_command) {
if (cmd->common.opcode != nvme_fabrics_command) {
pr_err("invalid command 0x%x on unconnected queue.\n",
cmd->fabrics.opcode);
return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
Expand Down

0 comments on commit 2dbf581

Please sign in to comment.