nvmed: reset featureStore in NVMeSubsystem::markFunctional(false)

When MCTP reactor restarts or the MCTP endpoint disconnects,
NVMeSubsystem::markFunctional(false) clears attached volumes and
controllers, but previously omitted resetting featureStore.

As a result, featureStore retained a dangling pointer to nvme_mi_ctrl_t
which was freed when the MCTP connection closed. When the endpoint
reconnected, initializeFeatureStore() exited early because featureStore
was already populated, preserving the stale controller reference.
Subsequent NVMe admin queries (such as nvme_mi_admin_get_log) then
accessed the freed memory, causing a SIGSEGV crash.

Reset featureStore in NVMeSubsystem::markFunctional(false) so that
the stale FeatureStore is properly destroyed and recreated with the
new controller upon reconnection.

Tested: Ran unit tests.
Google-Bug-Id: 565728782
Change-Id: Iae25de23fcd80373c4089365991233cb30a33395
Signed-off-by: Guangzong Chen <guangzong@google.com>
TAG=agy
CONV=05ec5ee7-d8a8-4299-9bd5-92c2d10bad16
1 file changed