mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
rpmsg: char: release allocated memory
commit bbe692e349
upstream.
In rpmsg_eptdev_write_iter, if copy_from_iter_full fails the allocated
buffer needs to be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3fe1ced40e
commit
5bbe72cf48
1 changed files with 4 additions and 2 deletions
|
@ -227,8 +227,10 @@ static ssize_t rpmsg_eptdev_write_iter(struct kiocb *iocb,
|
|||
if (!kbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!copy_from_iter_full(kbuf, len, from))
|
||||
return -EFAULT;
|
||||
if (!copy_from_iter_full(kbuf, len, from)) {
|
||||
ret = -EFAULT;
|
||||
goto free_kbuf;
|
||||
}
|
||||
|
||||
if (mutex_lock_interruptible(&eptdev->ept_lock)) {
|
||||
ret = -ERESTARTSYS;
|
||||
|
|
Loading…
Reference in a new issue