diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2017-11-08 12:00:29 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-11-10 19:53:25 -0700 |
commit | dafc040ba6d813df225a25f8b4bc3eae2207a6be (patch) | |
tree | ff5cfdf90aabee7e46d2dc8839152291ba4d1562 /drivers | |
parent | aba7afc5671c23beade64d10caf86e24a9105dab (diff) | |
download | linux-dafc040ba6d813df225a25f8b4bc3eae2207a6be.tar.bz2 |
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')
-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: /* |