[PATCH] staging: sm750fb: replace kzalloc with devm_kzalloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



replace kzalloc with devm_kzalloc thereby removing the corresponding
kfree.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@xxxxxxxxxxx>
---
 drivers/staging/sm750fb/sm750.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 3c7ea95..bb6beb0 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1112,7 +1112,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 	 * we use this marcro as the same */
 	spec_offset = offsetof(struct sm750_share, share);
 
-	spec_share = kzalloc(sizeof(*spec_share), GFP_KERNEL);
+	spec_share = devm_kzalloc(&pdev->dev, sizeof(*spec_share), GFP_KERNEL);
 	if (!spec_share) {
 		pr_err("Could not allocate memory for share.\n");
 		goto err_share;
@@ -1244,7 +1244,6 @@ err_info0_set:
 	framebuffer_release(info[0]);
 err_info0_alloc:
 err_map:
-	kfree(spec_share);
 err_share:
 err_enable:
 	return -ENODEV;
@@ -1285,7 +1284,6 @@ static void __exit lynxfb_pci_remove(struct pci_dev *pdev)
 	iounmap(share->pvMem);
 	spec_share = container_of(share, struct sm750_share, share);
 	kfree(g_settings);
-	kfree(spec_share);
 	pci_set_drvdata(pdev, NULL);
 }
 
-- 
1.9.1
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux