Commit dcb2cf1d authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Herbert Xu

crypto: ccree - use devm_kzalloc for device data

Move some remaining device data allocation to the safer devm_*
interface.
Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d574b707
...@@ -49,8 +49,6 @@ void cc_fips_fini(struct cc_drvdata *drvdata) ...@@ -49,8 +49,6 @@ void cc_fips_fini(struct cc_drvdata *drvdata)
/* Kill tasklet */ /* Kill tasklet */
tasklet_kill(&fips_h->tasklet); tasklet_kill(&fips_h->tasklet);
kfree(fips_h);
drvdata->fips_handle = NULL; drvdata->fips_handle = NULL;
} }
...@@ -104,7 +102,7 @@ int cc_fips_init(struct cc_drvdata *p_drvdata) ...@@ -104,7 +102,7 @@ int cc_fips_init(struct cc_drvdata *p_drvdata)
if (p_drvdata->hw_rev < CC_HW_REV_712) if (p_drvdata->hw_rev < CC_HW_REV_712)
return 0; return 0;
fips_h = kzalloc(sizeof(*fips_h), GFP_KERNEL); fips_h = devm_kzalloc(dev, sizeof(*fips_h), GFP_KERNEL);
if (!fips_h) if (!fips_h)
return -ENOMEM; return -ENOMEM;
......
...@@ -19,8 +19,7 @@ struct cc_sram_ctx { ...@@ -19,8 +19,7 @@ struct cc_sram_ctx {
*/ */
void cc_sram_mgr_fini(struct cc_drvdata *drvdata) void cc_sram_mgr_fini(struct cc_drvdata *drvdata)
{ {
/* Free "this" context */ /* Nothing needed */
kfree(drvdata->sram_mgr_handle);
} }
/** /**
...@@ -48,7 +47,7 @@ int cc_sram_mgr_init(struct cc_drvdata *drvdata) ...@@ -48,7 +47,7 @@ int cc_sram_mgr_init(struct cc_drvdata *drvdata)
} }
/* Allocate "this" context */ /* Allocate "this" context */
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx) if (!ctx)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment