]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: fix invalid memory reference in nvmet_subsys_attr_qid_max_show
authorDaniel Wagner <dwagner@suse.de>
Fri, 7 Oct 2022 07:29:34 +0000 (09:29 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 19 Oct 2022 10:43:13 +0000 (12:43 +0200)
commitd3d0932c783efc16ec5ae1a16ad768c2f6ae4a3e
treef45a99916e583dd8c721b8084057993686e3455c
parent6e4aa04d37ef4f4a34642f690b7d944d051ae5aa
nvmet: fix invalid memory reference in nvmet_subsys_attr_qid_max_show

The item passed into nvmet_subsys_attr_qid_max_show is not a member of
struct nvmet_port, it is part of nvmet_subsys.  Hence, don't try to
dereference it as struct nvme_ctrl pointer.

Fixes: 65b1e6817549 ("nvmet: Expose max queues to configfs")
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20220913064203.133536-1-dwagner@suse.de
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/configfs.c