diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2017-11-08 11:00:29 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-11-11 03:53:25 +0100 |
commit | dafc040ba6d813df225a25f8b4bc3eae2207a6be (patch) | |
tree | ff5cfdf90aabee7e46d2dc8839152291ba4d1562 /drivers/nvme | |
parent | blk-mq: Avoid that request queue removal can trigger list corruption (diff) | |
download | linux-dafc040ba6d813df225a25f8b4bc3eae2207a6be.tar.xz linux-dafc040ba6d813df225a25f8b4bc3eae2207a6be.zip |
nvmet: remove redundant memset if failed to get_smart_log failed
We already allocated the buffer with kzalloc.
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/admin-cmd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index 9a7d6917e190..dd087be395b9 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -144,10 +144,8 @@ static void nvmet_execute_get_log_page(struct nvmet_req *req) } smart_log = buf; status = nvmet_get_smart_log(req, smart_log); - if (status) { - memset(buf, '\0', data_len); + if (status) goto err; - } break; case NVME_LOG_FW_SLOT: /* |