Skip to content

Commit

Permalink
nvmet: remove redundant memset if failed to get_smart_log failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sagi Grimberg authored and Jens Axboe committed Nov 11, 2017
1 parent aba7afc commit dafc040
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/nvme/target/admin-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/*
Expand Down

0 comments on commit dafc040

Please sign in to comment.