diff mbox

padata: free correct variable

Message ID 20170407003330.6552-1-Jason@zx2c4.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Jason A. Donenfeld April 7, 2017, 12:33 a.m. UTC
The author meant to free the variable that was just allocated, instead
of the one that failed to be allocated, but made a simple typo. This
patch rectifies that.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: stable@vger.kernel.org
---
 kernel/padata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu April 10, 2017, 11:25 a.m. UTC | #1
Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> The author meant to free the variable that was just allocated, instead
> of the one that failed to be allocated, but made a simple typo. This
> patch rectifies that.
> 
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Cc: stable@vger.kernel.org

Patch applied.  Thanks.
diff mbox

Patch

diff --git a/kernel/padata.c b/kernel/padata.c
index 05316c9f32da..1faa7d62d87d 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -353,7 +353,7 @@  static int padata_setup_cpumasks(struct parallel_data *pd,
 
 	cpumask_and(pd->cpumask.pcpu, pcpumask, cpu_online_mask);
 	if (!alloc_cpumask_var(&pd->cpumask.cbcpu, GFP_KERNEL)) {
-		free_cpumask_var(pd->cpumask.cbcpu);
+		free_cpumask_var(pd->cpumask.pcpu);
 		return -ENOMEM;
 	}