All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] microcode loader updates
Date: Mon, 2 Mar 2015 14:29:50 +0100	[thread overview]
Message-ID: <20150302132950.GC17521@pd.tnic> (raw)
In-Reply-To: <20150302130336.GB14850@chrystal.home>

On Mon, Mar 02, 2015 at 02:03:36PM +0100, Quentin Casasnovas wrote:
> So at the last loop iteration for j == i, we'll do kfree(saved_ptr[j])
> which AFAICT hasn't been initialized yet.  Using a kcalloc() your first
> allocation for saved_ptr should just work since the memory will be cleared
> and kfree(NULL) doesn't do anything.

You're correct, but(!)...

Practically, this is not a problem because @mc_saved_src being handed
down to save_microcode() is at both call sites initialized up to
mc_saved_count elements and the loop in save_microcode() only inspects
this far.

So actually, this test is not really needed:

                if (!mc_saved_src[i]) {
                        ret = -EINVAL;
                        goto err;
                }

AFAICT and if I'm not missing anything else, of course.

In any case, I'd like to keep this series cleanup-only (well, except
this one) and address your comments later. Don't worry, I haven't
forgotten them - I want to *not* fix everything in one go.

Agreed?

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

  reply	other threads:[~2015-03-02 13:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 12:34 [GIT PULL] microcode loader updates Borislav Petkov
2015-03-02 13:03 ` Quentin Casasnovas
2015-03-02 13:29   ` Borislav Petkov [this message]
2015-03-02 13:42     ` Quentin Casasnovas
2015-03-02 15:04       ` Borislav Petkov
2015-03-02 15:29         ` Quentin Casasnovas
2015-03-02 17:48 ` Borislav Petkov
2015-03-03 12:55 ` Ingo Molnar

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=20150302132950.GC17521@pd.tnic \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quentin.casasnovas@oracle.com \
    --cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.