* [PATCH 1/3] staging/ft1000: Return -ENOMEM if kmalloc fails at ft1000_probe
@ 2012-06-19 12:45 Devendra Naga
0 siblings, 0 replies; only message in thread
From: Devendra Naga @ 2012-06-19 12:45 UTC (permalink / raw)
To: Marek Belisko, Greg Kroah-Hartman, devel, linux-kernel; +Cc: Devendra Naga
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>
---
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
index 84c38d5..a07c504 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
@@ -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));
--
1.7.9.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-19 12:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-19 12:45 [PATCH 1/3] staging/ft1000: Return -ENOMEM if kmalloc fails at ft1000_probe Devendra Naga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox