mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
crypto: caam - fix memleak in caam_jr module
This patch fixes a memory leak that appears when caam_jr module is unloaded. Cc: <[email protected]> # 3.13+ Signed-off-by: Cristian Stoica <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
cfe82d4f45
commit
0378c9a855
1 changed files with 3 additions and 5 deletions
|
|
@ -453,8 +453,8 @@ static int caam_jr_probe(struct platform_device *pdev)
|
|||
int error;
|
||||
|
||||
jrdev = &pdev->dev;
|
||||
jrpriv = kmalloc(sizeof(struct caam_drv_private_jr),
|
||||
GFP_KERNEL);
|
||||
jrpriv = devm_kmalloc(jrdev, sizeof(struct caam_drv_private_jr),
|
||||
GFP_KERNEL);
|
||||
if (!jrpriv)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -487,10 +487,8 @@ static int caam_jr_probe(struct platform_device *pdev)
|
|||
|
||||
/* Now do the platform independent part */
|
||||
error = caam_jr_init(jrdev); /* now turn on hardware */
|
||||
if (error) {
|
||||
kfree(jrpriv);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
||||
jrpriv->dev = jrdev;
|
||||
spin_lock(&driver_data.jr_alloc_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue