Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit caa6c4b6 authored by Pratham Pratap's avatar Pratham Pratap
Browse files

usb: f_fs: Fix memory leak if copy_from_iter_full fails



Consider a case where copy_from_iter_full fails and it
leads the driver to free the buffer which is allocated
for io_data but in ffs_free_buffer function, driver checks
for io_data->buf, which is NULL in this case, and it returns
without freeing the buffer causing memory leak. Fix this by
assigning data to io_data->buf right after memory allocation
for io_data is successful.

Change-Id: I20719fdeed603b74fe05215ec057d4cc22379ab2
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent ae23001f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment