]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nvmet: add a missing endianess conversion in nvmet_execute_admin_connect
authorChristoph Hellwig <hch@lst.de>
Tue, 28 Jan 2025 07:55:34 +0000 (08:55 +0100)
committerKeith Busch <kbusch@kernel.org>
Tue, 28 Jan 2025 15:07:21 +0000 (07:07 -0800)
The kato field is little endian on the wire, but native endian in
the in-core structure, add the missing byte swap.

Fixes: 6202783184bf ("nvmet: Improve nvmet_alloc_ctrl() interface and implementation")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/fabrics-cmd.c

index a7ff05b3be29fb8038a8e8ff5e1139caf02f96fe..eb406c90c16793b8890f79d16ae5505102ec0261 100644 (file)
@@ -287,7 +287,7 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req)
        args.subsysnqn = d->subsysnqn;
        args.hostnqn = d->hostnqn;
        args.hostid = &d->hostid;
-       args.kato = c->kato;
+       args.kato = le32_to_cpu(c->kato);
 
        ctrl = nvmet_alloc_ctrl(&args);
        if (!ctrl)