diff options
author | Hannes Reinecke <hare@suse.de> | 2019-01-08 12:46:58 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-01-09 13:47:06 -0500 |
commit | c7055fd15ff46d92eb0dd1c16a4fe010d58224c8 (patch) | |
tree | ddc6cfcf2ec26aa31e225d678b558a6793610f41 /drivers/nvme | |
parent | 9846ac0143fe9872e92fe2a1ddff868ad05bdbb6 (diff) |
nvme-multipath: zero out ANA log buffer
When nvme_init_identify() fails the ANA log buffer is deallocated
but _not_ set to NULL. This can cause double free oops when this
controller is deleted without ever being reconnected.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/multipath.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 183ec17ba067..df4b3a6db51b 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -570,6 +570,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) return 0; out_free_ana_log_buf: kfree(ctrl->ana_log_buf); + ctrl->ana_log_buf = NULL; out: return error; } @@ -577,5 +578,6 @@ out: void nvme_mpath_uninit(struct nvme_ctrl *ctrl) { kfree(ctrl->ana_log_buf); + ctrl->ana_log_buf = NULL; } |