From 5b2f716b34619a1f0ed6a59790a5fc76f302d3a7 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozaruk Date: Thu, 6 Jun 2013 11:03:16 +0300 Subject: ti-st: tty_hci: Check kzalloc return value. Check for error condition returned by kzalloc. Change-Id: I658cba57b9177ff68feb63d6a0e701d2a226960f Signed-off-by: Oleksandr Kozaruk --- drivers/misc/ti-st/tty_hci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/misc/ti-st/tty_hci.c') diff --git a/drivers/misc/ti-st/tty_hci.c b/drivers/misc/ti-st/tty_hci.c index c5b147e68ae..7a312d39aea 100644 --- a/drivers/misc/ti-st/tty_hci.c +++ b/drivers/misc/ti-st/tty_hci.c @@ -142,6 +142,9 @@ int hci_tty_open(struct inode *inod, struct file *file) pr_info("inside %s (%p, %p)\n", __func__, inod, file); hst = kzalloc(sizeof(*hst), GFP_KERNEL); + if (!hst) + return -ENOMEM; + file->private_data = hst; hst = file->private_data; -- cgit v1.2.3-70-g09d2