[PATCH 2/7] staging: sm750fb: remove needless goto statements and lables

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

 



In lynxfb_pci_probe return error immediately in cases no cleanup is
required.

Signed-off-by: Mike Rapoport <mike.rapoport@xxxxxxxxx>
---
 drivers/staging/sm750fb/sm750.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index c78421b..44a1edc 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1010,13 +1010,13 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 	/* enable device */
 	if (pci_enable_device(pdev)) {
 		pr_err("can not enable device.\n");
-		goto err_enable;
+		return -ENODEV;
 	}
 
 	sm750_dev = kzalloc(sizeof(*sm750_dev), GFP_KERNEL);
 	if (!sm750_dev) {
 		pr_err("Could not allocate memory for share.\n");
-		goto err_share;
+		return -ENODEV;
 	}
 
 	sm750_dev->fbinfo[0] = sm750_dev->fbinfo[1] = NULL;
@@ -1131,8 +1131,6 @@ err_info0_set:
 err_info0_alloc:
 err_map:
 	kfree(sm750_dev);
-err_share:
-err_enable:
 	return -ENODEV;
 }
 
-- 
2.1.0

_______________________________________________
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