[PATCH 6/6] staging: ft1000: Check return value of ft1000_CreateDevice().

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

 



Registering of misc device could fail so add checking
of return value.

Signed-off-by: Marek Belisko <marek.belisko@xxxxxxxxxxxxxxx>
---
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
index 57a235f..fd1f071 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
@@ -948,9 +948,12 @@ int reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *int
 	return rc;
     }
 
-
-    //Create character device, implemented by Jim
-    ft1000_CreateDevice(ft1000dev);
+	rc = ft1000_CreateDevice(ft1000dev);
+	if (rc) {
+		DEBUG("Could not register misc device :%d\n", rc);
+		free_netdev(netdev);
+		return rc;
+	}
 
     DEBUG ("reg_ft1000_netdev returned\n");
 
-- 
1.7.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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