KVM: SVM: Fix potential memory leak in svm_cpu_init()
Quoted 11 lines · Vitaly
Review
Quoted 3 lines
From: Miaohe Lin <[email protected]>
(quoted diff) +0
-0if (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 ...Review static int svm_cpu_init(int cpu) · line 1021
Quoted 3 lines
(quoted diff) +0
-0@@ -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-ENOMEMhere.
The var r is really unnecessary and we should clean it up. Thanks for your good suggest. I would send a patch v2 soon.
Quoted 4 lines
Anyways, your patch seems to be correct, so:
Reviewed-by Vitaly Kuznetsov <[email protected]>
Thanks for your review.