* [PATCH 07/15] staging: tm6000: check kzalloc() result
@ 2010-07-16 16:14 Kulikov Vasiliy
0 siblings, 0 replies; only message in thread
From: Kulikov Vasiliy @ 2010-07-16 16:14 UTC (permalink / raw)
To: kernel-janitors
Cc: Greg Kroah-Hartman, Mauro Carvalho Chehab, Stefan Ringel,
Michel Ludwig, Beholder Intl. Ltd. Dmitry Belimov, devel,
linux-kernel
If kzalloc() fails exit with -ENOMEM.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
drivers/staging/tm6000/tm6000-core.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c
index 2c38199..9c2829e 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -40,8 +40,11 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,
static int ini = 0, last = 0, n = 0;
u8 *data = NULL;
- if (len)
+ if (len) {
data = kzalloc(len, GFP_KERNEL);
+ if (data == NULL)
+ return -ENOMEM;
+ }
if (req_type & USB_DIR_IN)
--
1.7.0.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-16 16:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-16 16:14 [PATCH 07/15] staging: tm6000: check kzalloc() result Kulikov Vasiliy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®