]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
nvmet-rdma: Fix NULL deref when setting pi_enable and traddr INADDR_ANY
authorIsrael Rukshin <israelr@nvidia.com>
Sun, 10 Jan 2021 12:09:05 +0000 (14:09 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 14 Jan 2021 19:27:34 +0000 (20:27 +0100)
commit7a84665619bb5da8c8b6517157875a1fd7632014
treee7fcd11b8847e2a0670e8f0744397e6d04b5ae6a
parent5342fd4255021ef0c4ce7be52eea1c4ebda11c63
nvmet-rdma: Fix NULL deref when setting pi_enable and traddr INADDR_ANY

When setting port traddr to INADDR_ANY, the listening cm_id->device
is NULL. The associate IB device is known only when a connect request
event arrives, so checking T10-PI device capability should be done
at this stage.

Fixes: b09160c3996c ("nvmet-rdma: add metadata/T10-PI support")
Signed-off-by: Israel Rukshin <israelr@nvidia.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/rdma.c