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:
Pratham Pratap <prathampratap@codeaurora.org>
Loading
Please register or sign in to comment