[coreboot] [PATCH] Die properly if CBFS can't find a stage

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sat Sep 26 21:49:37 CEST 2009


Hi Stefan,

any updates on that patch?

Regards,
Carl-Daniel

On 27.08.2009 13:15, Stefan Reinauer wrote:
> There are many other places where this is hit.. I am currently preparing
> a more extensive patch, stay tuned
>
> On 8/27/09 5:30 AM, Carl-Daniel Hailfinger wrote:
>   
>> cbfs_and_run_core() did not check the return code of cbfs_load_stage()
>> and jumped to (void*)-1 on error.
>> Die properly instead.
>> I didn't use die() because that caused a linker error.
>>
>> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>>
>> Index: LinuxBIOSv2-asus_m2a-vm/src/arch/i386/lib/cbfs_and_run.c
>> ===================================================================
>> --- LinuxBIOSv2-asus_m2a-vm/src/arch/i386/lib/cbfs_and_run.c	(Revision 4589)
>> +++ LinuxBIOSv2-asus_m2a-vm/src/arch/i386/lib/cbfs_and_run.c	(Arbeitskopie)
>> @@ -11,6 +11,11 @@
>>  	u8 *dst;
>>  	print_debug("Jumping to image.\r\n");
>>  	dst = cbfs_load_stage(filename);
>> +	if (dst == (void *) -1) {
>> +		/* We should use die() here. */
>> +		print_emerg("Loading stage failed!\n");
>> +		for (;;);
>> +	}
>>  	print_debug("Jumping to image.\r\n");
>>  
>>  	__asm__ volatile (
>>
>>
>>   
>>     
>
>
>   


-- 
http://www.hailfinger.org/





More information about the coreboot mailing list