From patchwork Mon Dec 14 15:57:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 11972451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2DD3C4361B for ; Mon, 14 Dec 2020 16:19:12 +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 549D522582 for ; Mon, 14 Dec 2020 16:19:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 549D522582 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koqZ5-00018L-3g for qemu-devel@archiver.kernel.org; Mon, 14 Dec 2020 11:19:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koqEj-00086M-DT; Mon, 14 Dec 2020 10:58:09 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:54421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koqEd-0001Tk-85; Mon, 14 Dec 2020 10:58:09 -0500 Received: from localhost.localdomain ([82.252.135.218]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N4i7l-1k4t0W0EB5-011fGC; Mon, 14 Dec 2020 16:57:47 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 12/19] block/file-posix: fix a possible undefined behavior Date: Mon, 14 Dec 2020 16:57:26 +0100 Message-Id: <20201214155733.207430-13-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214155733.207430-1-laurent@vivier.eu> References: <20201214155733.207430-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:qLDPQrEQtWG2Dg8c4z8b4jPx7wioZRQYyfh02lniGNRyZgW6mcH yhMzXtwahF9OUjwU9OMfdyrh4hmSD2pnjckaIx0kDeS8plhW4OPaQJJmXCCBJ9p2c625S6j hb7CAJq8hMjzsthFFp78RH7aKlmfwCy0BWXtM1pWc0OSuhiBqxK5HkUX0OemwtvmD63H1fL HCGKR3AnaIwPCkUPRbHFw== X-UI-Out-Filterresults: notjunk:1;V03:K0:3mjSvXPmnhs=:NPP9GK/c2W8/WX3hkIKezS cDOIlq2Ng7CrvMIsf4AQtoLGzRzJ0edp5v0rhpiEWWrTmELQ/2O7IBnJWuBik8QPNKucnHsvT gixjUh6YRgFMhFVwETcuDkLXJv2Upp9PTxxTCVCxUQ9XbGV3HoaNWjCevKOyxRgo6V4Gtkwe7 n710NQgNL7FxranOuJK8o5K9h+Bst5aBys6Ly9tPcTXanSIX7BmZwkd6lU49ucggCY9LOrrSG cQBFWsQlkcEts2TjGEJTBgu9wCYne+NTI0reoss4/fnAg0Za7y+tekXHNCp+en2gNnnkDoqRI +ssJFxsUKFtKdQsDgRllRf+eRYn/yWgyNrHaKHvfXW9ZIIPIB2e8/PBSAPObYOdWbCoLOn6oY do4DarAO0QerLAGWDBSNtgfkIkg3xbmuMiEN7/D80X3qPcAC6C5A67sPDNL4cTIRI8EPeQ93p Ywz04Wcu7Q== Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 , Li Qiang , qemu-trivial@nongnu.org, Michael Tokarev , Pan Nengyuan , Laurent Vivier , Euler Robot , Chen Qun , Stefano Garzarella Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Pan Nengyuan local_err is not initialized to NULL, it will cause a assert error as below: qemu/util/error.c:59: error_setv: Assertion `*errp == NULL' failed. Fixes: c6447510690 Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Stefano Garzarella Reviewed-by: Kevin Wolf Reviewed-by: Li Qiang Signed-off-by: Chen Qun Message-Id: <20201023061218.2080844-8-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 83e2cc55306c..9804681d5c44 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2111,7 +2111,7 @@ static void raw_aio_attach_aio_context(BlockDriverState *bs, #endif #ifdef CONFIG_LINUX_IO_URING if (s->use_linux_io_uring) { - Error *local_err; + Error *local_err = NULL; if (!aio_setup_linux_io_uring(new_context, &local_err)) { error_reportf_err(local_err, "Unable to use linux io_uring, " "falling back to thread pool: ");