nvmet: avoid dereferencing nvmet_req
authorMax Gurtovoy <maxg@mellanox.com>
Mon, 23 Jan 2017 09:01:12 +0000 (11:01 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 22 Feb 2017 20:34:00 +0000 (13:34 -0700)
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>
drivers/nvme/target/fabrics-cmd.c

index 18dc314601c3e3c7ec99175d16fded043b3adb13..8bd022af3df6741ed1b08f10bb7b6dce40fe6925 100644 (file)
@@ -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;