From patchwork Thu Dec 5 15:20:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 11274961 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3FED914BD for ; Thu, 5 Dec 2019 15:33:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2061821823 for ; Thu, 5 Dec 2019 15:33:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2061821823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:56339 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ict8A-0004xQ-Jl for patchwork-qemu-devel@patchwork.kernel.org; Thu, 05 Dec 2019 10:33:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49037) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icswL-0000J9-7a for qemu-devel@nongnu.org; Thu, 05 Dec 2019 10:21:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icswF-000642-4A for qemu-devel@nongnu.org; Thu, 05 Dec 2019 10:21:08 -0500 Received: from relay.sw.ru ([185.231.240.75]:43568) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1icswD-0005dS-57; Thu, 05 Dec 2019 10:21:06 -0500 Received: from vovaso.qa.sw.ru ([10.94.3.0] helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1icsvf-00007O-Nx; Thu, 05 Dec 2019 18:20:31 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org 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 Message-Id: <20191205152019.8454-22-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191205152019.8454-1-vsementsov@virtuozzo.com> References: <20191205152019.8454-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , vsementsov@virtuozzo.com, qemu-block@nongnu.org, armbru@redhat.com, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Eric Blake --- 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) {