lkml.org 
[lkml]   [2020]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] KVM: SVM: Fix potential memory leak in svm_cpu_init()
Date
Vitaly writes:
>> From: Miaohe Lin <linmiaohe@huawei.com>
>> if (svm_sev_enabled()) {
>> r = -ENOMEM;
>
>Not your fault but this assignment to 'r' seem to be redundant: it is already set to '-ENOMEM' above, but this is also not perfect as ...
>
>> @@ -1020,14 +1020,16 @@ static int svm_cpu_init(int cpu)
>> sizeof(void *),
>> return r;
>
>... '-ENOMEM' is actually the only possible outcome here. In case you'll be re-submitting, I'd suggest we drop 'r' entirely and just reture -ENOMEM here.

The var r is really unnecessary and we should clean it up. Thanks for your good suggest. I would send a patch v2 soon.

>
>Anyways, your patch seems to be correct, so:
>
>Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Thanks for your review.

\
 
 \ /
  Last update: 2020-01-03 03:21    [W:0.035 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site