staging/ft1000: Return -ENOMEM if kmalloc fails at ft1000_probe
authorDevendra Naga <devendra.aaru@gmail.com>
Tue, 19 Jun 2012 12:45:25 +0000 (18:15 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2012 23:07:07 +0000 (16:07 -0700)
If the kmalloc fails return -ENOMEM , returning 0 is not the proper
way if any function fails

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c

index 84c38d5c9397dc0ac31ac1a28a6047667f5eabb4..a07c504eb029931638f5a128ff6ddb3ce2fbe586 100644 (file)
@@ -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));