diff options
Diffstat (limited to 'drivers/nvme/host/multipath.c')
| -rw-r--r-- | drivers/nvme/host/multipath.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 183ec17ba067..b9fff3b8ed1b 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c | |||
| @@ -545,8 +545,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) | |||
| 545 | timer_setup(&ctrl->anatt_timer, nvme_anatt_timeout, 0); | 545 | timer_setup(&ctrl->anatt_timer, nvme_anatt_timeout, 0); |
| 546 | ctrl->ana_log_size = sizeof(struct nvme_ana_rsp_hdr) + | 546 | ctrl->ana_log_size = sizeof(struct nvme_ana_rsp_hdr) + |
| 547 | ctrl->nanagrpid * sizeof(struct nvme_ana_group_desc); | 547 | ctrl->nanagrpid * sizeof(struct nvme_ana_group_desc); |
| 548 | if (!(ctrl->anacap & (1 << 6))) | 548 | ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32); |
| 549 | ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32); | ||
| 550 | 549 | ||
| 551 | if (ctrl->ana_log_size > ctrl->max_hw_sectors << SECTOR_SHIFT) { | 550 | if (ctrl->ana_log_size > ctrl->max_hw_sectors << SECTOR_SHIFT) { |
| 552 | dev_err(ctrl->device, | 551 | dev_err(ctrl->device, |
| @@ -570,6 +569,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) | |||
| 570 | return 0; | 569 | return 0; |
| 571 | out_free_ana_log_buf: | 570 | out_free_ana_log_buf: |
| 572 | kfree(ctrl->ana_log_buf); | 571 | kfree(ctrl->ana_log_buf); |
| 572 | ctrl->ana_log_buf = NULL; | ||
| 573 | out: | 573 | out: |
| 574 | return error; | 574 | return error; |
| 575 | } | 575 | } |
| @@ -577,5 +577,6 @@ out: | |||
| 577 | void nvme_mpath_uninit(struct nvme_ctrl *ctrl) | 577 | void nvme_mpath_uninit(struct nvme_ctrl *ctrl) |
| 578 | { | 578 | { |
| 579 | kfree(ctrl->ana_log_buf); | 579 | kfree(ctrl->ana_log_buf); |
| 580 | ctrl->ana_log_buf = NULL; | ||
| 580 | } | 581 | } |
| 581 | 582 | ||
