diff options
author | Anca Jeanina FLOAREA <anca.floarea@freescale.com> | 2013-06-14 12:52:04 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-07-05 21:38:34 (GMT) |
commit | 5150425a9186c9f66bcae725ed478e345c82b22e (patch) | |
tree | c38711ac79678d1bbb37348f3cc6f822797dcb42 /drivers | |
parent | fa729e4c7a01b346fbbc923f8c11d5cc31c1ab10 (diff) | |
download | linux-fsl-qoriq-5150425a9186c9f66bcae725ed478e345c82b22e.tar.xz |
dpa_offload: Fix memory leak when plcr allocation failed
In function store_policy_param_to_sa_pol_list in case memory
allocation of plcr failed, then the memory occupied by
pol_entry needs to be released.
Signed-off-by: Anca Jeanina FLOAREA <anca.floarea@freescale.com>
Change-Id: I88fd3ba1403b6af4d41d06ebd179219db9b84420
Reviewed-on: http://git.am.freescale.net:8181/2970
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Chereji Marian-Cornel-R27762 <marian.chereji@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/fsl_dpa_offload/dpa_ipsec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/fsl_dpa_offload/dpa_ipsec.c b/drivers/staging/fsl_dpa_offload/dpa_ipsec.c index 902a0fa..fb076f4 100644 --- a/drivers/staging/fsl_dpa_offload/dpa_ipsec.c +++ b/drivers/staging/fsl_dpa_offload/dpa_ipsec.c @@ -2706,6 +2706,7 @@ static int store_policy_param_to_sa_pol_list(struct dpa_ipsec_sa *sa, plcr = kzalloc(sizeof(*plcr), GFP_KERNEL); if (!plcr) { pr_err("Could not allocate memory for policer\n"); + kfree(pol_entry); return -ENOMEM; } memcpy(plcr, dir->in_action.enq_params.policer_params, |