Skip to content

Commit dafc040

Browse files
sagigrimbergaxboe
authored andcommitted
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>
1 parent aba7afc commit dafc040

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/nvme/target/admin-cmd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,8 @@ static void nvmet_execute_get_log_page(struct nvmet_req *req)
144144
}
145145
smart_log = buf;
146146
status = nvmet_get_smart_log(req, smart_log);
147-
if (status) {
148-
memset(buf, '\0', data_len);
147+
if (status)
149148
goto err;
150-
}
151149
break;
152150
case NVME_LOG_FW_SLOT:
153151
/*

0 commit comments

Comments
 (0)