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

Commit 3a2a598a authored by Mayank Rana's avatar Mayank Rana
Browse files

USB: android: Fix error handling when ffs_func_bind fails



In some cases it is observed that usb_add_function() fails with
ffs_function_bind_config() due to ffs_func_bind() fails. When
adbd closes eps, it is trying to reference NULL function pointer
as below:
  __fput
     |
ffs_epfile_release
     |
ffs_data_closed
     |
ffs_data_clear
     |
functionfs_closed_callback
     |
usb_put_function()

Hence handle error case and add check with config->func against NULL.

CRs-Fixed: 848903
Change-Id: Idd260655b8944bd6b21f7bbe3c0340af88f99dfd
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent d3846f3c
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