From nobody Fri May 3 01:22:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490891757546699.1341891845284; Thu, 30 Mar 2017 09:35:57 -0700 (PDT) Received: from localhost ([::1]:36734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctd3E-0003vz-B8 for importer@patchew.org; Thu, 30 Mar 2017 12:35:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctd2F-0003Jd-Gh for qemu-devel@nongnu.org; Thu, 30 Mar 2017 12:34:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctd2B-0005V9-LF for qemu-devel@nongnu.org; Thu, 30 Mar 2017 12:34:55 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:33845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ctd2B-0005UX-FZ for qemu-devel@nongnu.org; Thu, 30 Mar 2017 12:34:51 -0400 Received: by mail-pg0-x244.google.com with SMTP id o123so11274668pga.1 for ; Thu, 30 Mar 2017 09:34:51 -0700 (PDT) Received: from localhost.localdomain.com ([117.224.190.38]) by smtp.gmail.com with ESMTPSA id t12sm5580134pfg.14.2017.03.30.09.34.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 09:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=L6yFsBetYi9C+evAuIr+LFWUwCjIv00u/5eSV33lUo8=; b=FswRg8n0PKs+Njfw0HArJiQgytGCknl99AYb/3OQTvd6kW9uPoeM9syt8gVYhBGwwr 60D1sKCofUVipk+41fhWiaNMWXL0f8Xs/UdDmRoBqhaKzz2orgc3UpRrcbK9NCfj5R9/ /SstYLyFFcXymS5YSXrEZuo7Q/LvHUIYLcxrAdQFT3Z3PrwDzmk2NlSJM0Gb5loYq2Nn 9bJCNhPawQL3CjkKf4B3DzwZKT9eig3+IghVKWBVnkBjSLuBY7yXsMS3fMjUp7mXO+Rf BFEbjI0CNRR6dQXXmpe7NTJqm+5KYiQWjHHspf159SUWYRK/V5Y9gXtCY/Blk1lj7xAS QnZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=L6yFsBetYi9C+evAuIr+LFWUwCjIv00u/5eSV33lUo8=; b=KFITo9Lkk4GuC2AZPcG7pNUpB7CkPOAby94SGq/Rd++CSG4HtGvcAzDCEF025YMML6 PR8fd+oqOW2JuifnrEq8VkiJ+ngdMhVDJtwXYqIKgIye1NB650mbitYWG1JlxMAjzifE YDZ+Y4KMMuV1vT+uRDyh46HJx8nBE7UlaRFhppH6xxSIa10pOt5sjyum5m09u4+r6iuF OTKygBOfDInoGpomfdzIz6KogSH8mb/fzo6lUDmYh1ZLAOipv3S7ICVkTyLnsp8NbHk6 2Hu2dgmgjo2jW26UPJe5NdB8j7H5kRNlE979oUKEUMwDjTqRXkcfatILX+1fwop2G/wq a1mA== X-Gm-Message-State: AFeK/H1ZrJVFxq7OtQSZZV84FSX4QjG7xDBTeRlsqdsC8E1WsgvKNZ8SH+9RUcEQZ4LuAg== X-Received: by 10.99.56.20 with SMTP id f20mr555955pga.167.1490891690376; Thu, 30 Mar 2017 09:34:50 -0700 (PDT) From: Suramya Shah To: qemu-devel@nongnu.org Date: Thu, 30 Mar 2017 22:04:07 +0530 Message-Id: <20170330163407.26263-1-shah.suramya@gmail.com> X-Mailer: git-send-email 2.9.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::244 Subject: [Qemu-devel] [PATCH v4] hw/unicore32: remove wrong assertion in puv machine init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcel@redhat.com, gxt@mprc.pku.edu.cn, Suramya Shah Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Running QEMU with qemu-system-unicore32 without the kernel parameter result= s in an assertion error.Assert should not be used to check user provided pa= rameters. Report an error and exit instead Signed-off-by: Suramya Shah --- hw/unicore32/puv3.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index 032078f..2c17cc9 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -93,8 +93,11 @@ static void puv3_load_kernel(const char *kernel_filename) if (kernel_filename =3D=3D NULL && qtest_enabled()) { return; } - assert(kernel_filename !=3D NULL); - + if (kernel_filename =3D=3D NULL) { + error_report("No kernel found"); + exit(1); + } + /* only zImage format supported */ size =3D load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR, KERNEL_MAX_SIZE); --=20 2.9.3