diff options
author | Haiying Wang <Haiying.Wang@freescale.com> | 2013-05-28 21:37:51 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-05-29 23:55:38 (GMT) |
commit | 9820824768b1d29224e197b4ebe57fc910a5450c (patch) | |
tree | a7d663c116bf39ce85ac4d346b613f7bd44609b2 /drivers/staging | |
parent | 9d36d454b2f2183ba3f7670b70e6c007dd93ff1a (diff) | |
download | linux-fsl-qoriq-9820824768b1d29224e197b4ebe57fc910a5450c.tar.xz |
fsl_bman: remove the extra kmalloc which causes memleak
because the later pointer assignments overwrite the results of the kmalloc.
This memleak can be detect after turning on kernel memleak detector.
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Change-Id: If21cc0f8084271d9fe6f73e51dd3ad200ebdad67
Reviewed-on: http://git.am.freescale.net:8181/2747
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Pledge Roy-R01356 <roy.pledge@freescale.com>
Reviewed-by: Thorpe Geoff-R01361 <Geoff.Thorpe@freescale.com>
Reviewed-by: Ladouceur Jeffrey-R11498 <Jeffrey.Ladouceur@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/fsl_qbman/bman_config.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/staging/fsl_qbman/bman_config.c b/drivers/staging/fsl_qbman/bman_config.c index 4ea7418..a2f2ad4 100644 --- a/drivers/staging/fsl_qbman/bman_config.c +++ b/drivers/staging/fsl_qbman/bman_config.c @@ -634,16 +634,6 @@ static int __devinit of_fsl_bman_probe(struct platform_device *ofdev) goto del_group_3; } - for (i = 0; i < (bman_pool_max + 1); i++) { - bman_dev_pool_count_attributes[i] = - kmalloc(sizeof(struct attribute), GFP_KERNEL); - if (!bman_dev_pool_count_attributes[i]) { - pr_err("cannot alloc for each" - " bman_dev_pool_count_attributes\n"); - goto del_group_3; - } - } - for (i = 0; i < bman_pool_max; i++) { ret = scnprintf((name_attrs_pool_count + i * 3), 3, "%d", i); if (!ret) @@ -666,8 +656,6 @@ static int __devinit of_fsl_bman_probe(struct platform_device *ofdev) goto done; del_group_4: - for (i = 0; i < (bman_pool_max + 1); i++) - kfree(bman_dev_pool_count_attributes[i]); kfree(bman_dev_pool_count_attributes); del_group_3: kfree(dev_attr_buffer_pool_count); |