[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH for-4.14 v2] tools/xen-ucode: fix error code propagation of microcode load operation
On 16/06/2020 13:25, Jan Beulich wrote: > [CAUTION - EXTERNAL EMAIL] DO NOT reply, click links, or open attachments > unless you have verified the sender and know the content is safe. > > On 16.06.2020 13:42, Igor Druzhinin wrote: >> @@ -62,8 +62,11 @@ int main(int argc, char *argv[]) >> >> ret = xc_microcode_update(xch, buf, len); >> if ( ret ) >> + { >> fprintf(stderr, "Failed to update microcode. (err: %s)\n", >> strerror(errno)); >> + return errno; > > I think you need to latch errno, as fprintf() may in principle run > into another error. Yes, I also noticed that but the whole file has this problem so I didn't change it here specifically. If fixing the whole file - I'd rather rewrite error reporting completely: return 1 on error, 0 on success, etc. From what I've read returning errno has many incompatibilities and might lead to surprise consequences. I'll send v3 to clean this all up. Igor
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |