Skip to contentSkip to conversation

staging/ft1000: Return -ENOMEM if kmalloc fails at ft1000_probe

PATCH New Devendra Naga 1 participant 1 message Jun 19, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 staging/ft1000: Return -ENOMEM if kmalloc fails at ft1000_probe

If the kmalloc fails return -ENOMEM , returning 0 is not the proper way if any function fails

---
 drivers/staging/ft1000/ft1000-usb/ft1000_usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +1 -1
index 84c38d5..a07c504 100644
@@ -71,7 +71,7 @@ static int ft1000_probe(struct usb_interface *interface,
 
 	if (!ft1000dev) {
 		printk(KERN_ERR "out of memory allocating device structure\n");
-		return 0;
+		return -ENOMEM;
 	}
 
 	memset(ft1000dev, 0, sizeof(*ft1000dev));
Signature · 1 line
1.7.9.5