summaryrefslogtreecommitdiff
path: root/lib/mpi/mpiutil.c
diff options
context:
space:
mode:
authorZiye Yang <ziye.yang@intel.com>2020-08-22 00:48:10 +0800
committerSagi Grimberg <sagi@grimberg.me>2020-08-28 16:43:56 -0700
commita6ce7d7b4adaebc27ee7e78e5ecc378a1cfc221d (patch)
tree79c7391c7d8fc53c5b9cdb084eac3e216987b00c /lib/mpi/mpiutil.c
parenta433d7217feab712ff69ef5cc2a86f95ed1aca40 (diff)
nvmet-tcp: Fix NULL dereference when a connect data comes in h2cdata pdu
When handling commands without in-capsule data, we assign the ttag assuming we already have the queue commands array allocated (based on the queue size information in the connect data payload). However if the connect itself did not send the connect data in-capsule we have yet to allocate the queue commands,and we will assign a bogus ttag and suffer a NULL dereference when we receive the corresponding h2cdata pdu. Fix this by checking if we already allocated commands before dereferencing it when handling h2cdata, if we didn't, its for sure a connect and we should use the preallocated connect command. Signed-off-by: Ziye Yang <ziye.yang@intel.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions