Skip to content

Commit 7993b0f

Browse files
committed
Merge remote-tracking branch 'remotes/nvme/tags/nvme-fixes-for-6.0-pull-request' into staging
emulated nvme fixes # gpg: Signature made Mon 29 Mar 2021 18:03:30 BST # gpg: using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9 # gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown] # gpg: aka "Klaus Jensen <k.jensen@samsung.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468 4272 63D5 6FC5 E55D A838 # Subkey fingerprint: 5228 33AA 75E2 DCE6 A247 66C0 4DE1 AF31 6D4F 0DE9 * remotes/nvme/tags/nvme-fixes-for-6.0-pull-request: hw/block/nvme: fix ref counting in nvme_format_ns hw/block/nvme: fix resource leak in nvme_dif_rw Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 parents ec2e6e0 + 3a69cad commit 7993b0f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

hw/block/nvme-dif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ uint16_t nvme_dif_rw(NvmeCtrl *n, NvmeRequest *req)
432432

433433
status = nvme_map_dptr(n, &req->sg, mapped_len, &req->cmd);
434434
if (status) {
435-
return status;
435+
goto err;
436436
}
437437

438438
ctx->data.bounce = g_malloc(len);

hw/block/nvme.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5009,9 +5009,15 @@ static uint16_t nvme_format_ns(NvmeCtrl *n, NvmeNamespace *ns, uint8_t lbaf,
50095009

50105010
}
50115011

5012-
(*count)--;
5012+
if (--(*count)) {
5013+
return NVME_NO_COMPLETE;
5014+
}
50135015

5014-
return NVME_NO_COMPLETE;
5016+
g_free(count);
5017+
ns->status = 0x0;
5018+
(*num_formats)--;
5019+
5020+
return NVME_SUCCESS;
50155021
}
50165022

50175023
static uint16_t nvme_format(NvmeCtrl *n, NvmeRequest *req)

0 commit comments

Comments
 (0)