Skip to contentSkip to conversation

nvmet: avoid dereferencing nvmet_req

PATCH New Max Gurtovoy 3 participants 3 messages Jan 23, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmet: avoid dereferencing nvmet_req

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 at mellanox.com>
Reviewed-by Parav Pandit <parav at mellanox.com>
---
 drivers/nvme/target/fabrics-cmd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/nvme/target/fabrics-cmd.c +1 -1
index f408819..11c6682 100644
@@ -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;
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 nvmet: avoid dereferencing nvmet_req

Quoted 5 lines · Max Gurtovoy

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 at mellanox.com>
Reviewed-by Parav Pandit <parav at mellanox.com>

Looks good (for 4.11)