[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channe
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error |
Date: |
Thu, 5 Dec 2019 18:20:19 +0300 |
The local_err parameter is not here to return information about
nbd_iter_channel_error failure. Instead it's assumed to be filled when
passed to the function. This is already stressed by its name
(local_err, instead of classic errp). Stress it additionally by
assertion.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/nbd.c b/block/nbd.c
index 5f18f78a94..d085554f21 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -866,6 +866,7 @@ typedef struct NBDReplyChunkIter {
static void nbd_iter_channel_error(NBDReplyChunkIter *iter,
int ret, Error **local_err)
{
+ assert(local_err && *local_err);
assert(ret < 0);
if (!iter->ret) {
--
2.21.0
- Re: [PATCH v7 08/21] 9pfs: well form error hint helpers, (continued)
- [PATCH v7 09/21] hw/core/qdev: cleanup Error ** variables, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v7 20/21] hw/vfio/ap: drop local_err from vfio_ap_realize, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v7 11/21] hw/i386/amd_iommu: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v7 10/21] block/snapshot: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v7 14/21] hw/s390x: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v7 12/21] qga: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v7 18/21] include/qom/object.h: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v7 17/21] hw/usb: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/12/05
- [PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error,
Vladimir Sementsov-Ogievskiy <=
- Re: [PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error, Markus Armbruster, 2019/12/06
- Re: [PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error, Vladimir Sementsov-Ogievskiy, 2019/12/06
[PATCH v7 07/21] ppc: well form kvmppc_hint_smt_possible error hint helper, Vladimir Sementsov-Ogievskiy, 2019/12/05