diff options
| author | Oleksandr Kozaruk <oleksandr.kozaruk@ti.com> | 2013-06-06 11:03:16 +0300 |
|---|---|---|
| committer | James Wylder <jwylder@motorola.com> | 2014-03-05 17:47:31 -0600 |
| commit | 5b2f716b34619a1f0ed6a59790a5fc76f302d3a7 (patch) | |
| tree | b0f8686b84ef906980dd9671794ae224effddc4c /drivers/misc/ti-st/tty_hci.c | |
| parent | f980fd96b7f99639b241e3476d2388ee602ebc22 (diff) | |
| download | olio-linux-3.10-5b2f716b34619a1f0ed6a59790a5fc76f302d3a7.tar.xz olio-linux-3.10-5b2f716b34619a1f0ed6a59790a5fc76f302d3a7.zip | |
ti-st: tty_hci: Check kzalloc return value.
Check for error condition returned by kzalloc.
Change-Id: I658cba57b9177ff68feb63d6a0e701d2a226960f
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
Diffstat (limited to 'drivers/misc/ti-st/tty_hci.c')
| -rw-r--r-- | drivers/misc/ti-st/tty_hci.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |