nvmet: remove redundant memset if failed to get_smart_log failed
authorSagi Grimberg <sagi@grimberg.me>
Wed, 8 Nov 2017 10:00:29 +0000 (12:00 +0200)
committerJens Axboe <axboe@kernel.dk>
Sat, 11 Nov 2017 02:53:25 +0000 (19:53 -0700)
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>
drivers/nvme/target/admin-cmd.c

index 9a7d691..dd087be 100644 (file)
@@ -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:
                /*