diff options
author | Axel Haslam <axelhaslam@ti.com> | 2011-02-04 13:28:49 -0600 |
---|---|---|
committer | Dan Murphy <dmurphy@ti.com> | 2011-02-24 14:33:04 -0600 |
commit | 57f118e05fc63914e23ea21d09a5cfcd32b225cd (patch) | |
tree | 9ff657a08b440b6276607e77ff5f9f0ec7968438 /drivers/staging | |
parent | e48f468964fc793c3ed479074deb22b7aa78c7c7 (diff) |
KW: HSI-CHAR: jump to exit label in case of error.
goto statment was missing. in case of a error, data
would be freed, and then used. Jump to exit
instead, after a error.
Change-Id: I244c1eaf33b6621c0f6b6902b8102fa7af8a25d7
Signed-off-by: Axel Haslam <axelhaslam@ti.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/omap_hsi/hsi-char.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/omap_hsi/hsi-char.c b/drivers/staging/omap_hsi/hsi-char.c index 16fc0c629ca8..d3d82ddbeda8 100644 --- a/drivers/staging/omap_hsi/hsi-char.c +++ b/drivers/staging/omap_hsi/hsi-char.c @@ -272,10 +272,14 @@ static ssize_t hsi_char_write(struct file *file, const char __user *buf, return -EINVAL; data = kmalloc(count, GFP_ATOMIC); - + if (!data) { + WARN_ON(1); + return -ENOMEM; + } if (copy_from_user(data, (void __user *)buf, count)) { ret = -EFAULT; kfree(data); + goto out2; } else { ret = count; } |