From: Igor Druzhinin <igor.druzhinin@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com,
wl@xen.org, xadimgnik@gmail.com
Subject: Re: [PATCH for-4.14 v2] tools/xen-ucode: fix error code propagation of microcode load operation
Date: Tue, 16 Jun 2020 13:40:37 +0100 [thread overview]
Message-ID: <4d0bacbf-506c-e3c3-5448-b5ab8f6dd0ba@citrix.com> (raw)
In-Reply-To: <be06eb9d-680c-d356-5f44-ba0a76c5b2a1@suse.com>
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
prev parent reply other threads:[~2020-06-16 12:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 11:42 [PATCH for-4.14 v2] tools/xen-ucode: fix error code propagation of microcode load operation Igor Druzhinin
2020-06-16 12:25 ` Jan Beulich
2020-06-16 12:40 ` Igor Druzhinin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4d0bacbf-506c-e3c3-5448-b5ab8f6dd0ba@citrix.com \
--to=igor.druzhinin@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=wl@xen.org \
--cc=xadimgnik@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).