From: Paolo Bonzini <pbonzini@redhat.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH -next] KVM: x86/mmu: Fix return value check in kvm_mmu_init_tdp_mmu()
Date: Fri, 1 Apr 2022 13:23:11 +0200 [thread overview]
Message-ID: <1b262351-c56a-9c85-6038-d23a425b34f0@redhat.com> (raw)
In-Reply-To: <20220401071531.1841927-1-yangyingliang@huawei.com>
On 4/1/22 09:15, Yang Yingliang wrote:
> If alloc_workqueue() fails, it returns NULL pointer, replaces
> IS_ERR() check with NULL pointer check.
>
> Fixes: 1a3320dd2939 ("KVM: MMU: propagate alloc_workqueue failure")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> arch/x86/kvm/mmu/tdp_mmu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
> index a2f9a34a0168..7bddbb51033a 100644
> --- a/arch/x86/kvm/mmu/tdp_mmu.c
> +++ b/arch/x86/kvm/mmu/tdp_mmu.c
> @@ -22,8 +22,8 @@ int kvm_mmu_init_tdp_mmu(struct kvm *kvm)
> return 0;
>
> wq = alloc_workqueue("kvm", WQ_UNBOUND|WQ_MEM_RECLAIM|WQ_CPU_INTENSIVE, 0);
> - if (IS_ERR(wq))
> - return PTR_ERR(wq);
> + if (!wq)
> + return -ENOMEM;
>
> /* This should not be changed for the lifetime of the VM. */
> kvm->arch.tdp_mmu_enabled = true;
Sent already by Dan Carpenter, thanks though!
Paolo
prev parent reply other threads:[~2022-04-01 11:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 7:15 Yang Yingliang
2022-04-01 11:23 ` Paolo Bonzini [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=1b262351-c56a-9c85-6038-d23a425b34f0@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yangyingliang@huawei.com \
/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
all inboxes | Powered by JetHome®