lib/ftl: check for io not being NULL before dereferencing
ftl_io_free() handles NULL io being passed, but shouldn't dereference it before returning. Change-Id: Ia705d4ab9f8b3569e9704a1f97e70f7579084efb Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462487 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
8500db5ee0
commit
06c7ef7f6a
@ -570,12 +570,13 @@ ftl_io_reset(struct ftl_io *io)
|
||||
void
|
||||
ftl_io_free(struct ftl_io *io)
|
||||
{
|
||||
struct ftl_io *parent = io->parent;
|
||||
struct ftl_io *parent;
|
||||
|
||||
if (!io) {
|
||||
return;
|
||||
}
|
||||
|
||||
parent = io->parent;
|
||||
if (parent && ftl_io_remove_child(io)) {
|
||||
ftl_io_complete(parent);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user