* [Qemu-devel] [PATCH] hw/unicore32: fix a kernel_filename!=NULL assertion error in puv3.c
@ 2017-03-30 14:57 Suramya Shah
2017-03-30 15:10 ` Suramya Shah
2017-03-30 15:20 ` Marcel Apfelbaum
0 siblings, 2 replies; 3+ messages in thread
From: Suramya Shah @ 2017-03-30 14:57 UTC (permalink / raw)
To: qemu-devel; +Cc: marcel, Suramya Shah
Signed-off-by: Suramya Shah <shah.suramya@gmail.com>
---
Running QEMU with qemu-system-unicore32 without the kernel parameter results in an assertion error.
Fix this by..
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 == NULL && qtest_enabled()) {
return;
}
- assert(kernel_filename != NULL);
-
+ if (kernel_filename == NULL) {
+ error_report("No kernel found");
+ exit(1);
+ }
+
/* only zImage format supported */
size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,
KERNEL_MAX_SIZE);
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/unicore32: fix a kernel_filename!=NULL assertion error in puv3.c
2017-03-30 14:57 [Qemu-devel] [PATCH] hw/unicore32: fix a kernel_filename!=NULL assertion error in puv3.c Suramya Shah
@ 2017-03-30 15:10 ` Suramya Shah
2017-03-30 15:20 ` Marcel Apfelbaum
1 sibling, 0 replies; 3+ messages in thread
From: Suramya Shah @ 2017-03-30 15:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Marcel Apfelbaum, gxt
Kindly have a look at the forwarded patch.
On 30-Mar-2017 8:28 PM, "Suramya Shah" <shah.suramya@gmail.com> wrote:
> Signed-off-by: Suramya Shah <shah.suramya@gmail.com>
> ---
> Running QEMU with qemu-system-unicore32 without the kernel parameter
> results in an assertion error.
> Fix this by..
> 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 == NULL && qtest_enabled()) {
> return;
> }
> - assert(kernel_filename != NULL);
> -
> + if (kernel_filename == NULL) {
> + error_report("No kernel found");
> + exit(1);
> + }
> +
> /* only zImage format supported */
> size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,
> KERNEL_MAX_SIZE);
> --
> 2.9.3
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/unicore32: fix a kernel_filename!=NULL assertion error in puv3.c
2017-03-30 14:57 [Qemu-devel] [PATCH] hw/unicore32: fix a kernel_filename!=NULL assertion error in puv3.c Suramya Shah
2017-03-30 15:10 ` Suramya Shah
@ 2017-03-30 15:20 ` Marcel Apfelbaum
1 sibling, 0 replies; 3+ messages in thread
From: Marcel Apfelbaum @ 2017-03-30 15:20 UTC (permalink / raw)
To: Suramya Shah, qemu-devel
On 03/30/2017 05:57 PM, Suramya Shah wrote:
> Signed-off-by: Suramya Shah <shah.suramya@gmail.com>
Hi,
Thank you for contributing to QEMU project.
I suggest to avoid details in the subject, use something like:
"hw/unicore32: remove wrong assertion in puv machine init"
> ---
> Running QEMU with qemu-system-unicore32 without the kernel parameter results in an assertion error.
The description should appear before the "---" separator.
The patch cannot be applied.
Please use git format-patch to prepare the patch.
Please run ./scripts/checkpatch.pl before sending the patch.
> Fix this by..
This is not enough for a description.
Try to briefly explain how/why you fixed it.
"Assert should not be used to check user provided parameters.
Report an error and exit instead"
Thanks,
Marcel
> 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 == NULL && qtest_enabled()) {
> return;
> }
> - assert(kernel_filename != NULL);
> -
> + if (kernel_filename == NULL) {
> + error_report("No kernel found");
> + exit(1);
> + }
> +
> /* only zImage format supported */
> size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,
> KERNEL_MAX_SIZE);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-30 15:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-30 14:57 [Qemu-devel] [PATCH] hw/unicore32: fix a kernel_filename!=NULL assertion error in puv3.c Suramya Shah
2017-03-30 15:10 ` Suramya Shah
2017-03-30 15:20 ` Marcel Apfelbaum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).