aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/caam/jr.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index 1d80bd3636c5..b512a4ba7569 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -453,8 +453,8 @@ static int caam_jr_probe(struct platform_device *pdev)
453 int error; 453 int error;
454 454
455 jrdev = &pdev->dev; 455 jrdev = &pdev->dev;
456 jrpriv = kmalloc(sizeof(struct caam_drv_private_jr), 456 jrpriv = devm_kmalloc(jrdev, sizeof(struct caam_drv_private_jr),
457 GFP_KERNEL); 457 GFP_KERNEL);
458 if (!jrpriv) 458 if (!jrpriv)
459 return -ENOMEM; 459 return -ENOMEM;
460 460
@@ -487,10 +487,8 @@ static int caam_jr_probe(struct platform_device *pdev)
487 487
488 /* Now do the platform independent part */ 488 /* Now do the platform independent part */
489 error = caam_jr_init(jrdev); /* now turn on hardware */ 489 error = caam_jr_init(jrdev); /* now turn on hardware */
490 if (error) { 490 if (error)
491 kfree(jrpriv);
492 return error; 491 return error;
493 }
494 492
495 jrpriv->dev = jrdev; 493 jrpriv->dev = jrdev;
496 spin_lock(&driver_data.jr_alloc_lock); 494 spin_lock(&driver_data.jr_alloc_lock);