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

Skip to content
Commit 036ac58d authored by Jack Pham's avatar Jack Pham
Browse files

usb: gadget: f_fs: Fix NULL reference in ffs_func_bind()



commit e4ed11d6 ("usb: gadget: f_fs: Support multi-instance IPC
logging") moved the ipc_log context pointer to struct ffs_data, so
using ffs_log() requires an instance of 'ffs' pointer. In
ffs_do_functionfs_bind() this pointer is obtained via
ffs_opts->dev->ffs_data.  However in case userspace has not
written out the descriptors, at the time of function bind, this
would be NULL and result in invalid dereference by the log macro.
For this instance there is no other way to obtain the ffs_data so
simply drop this log to avoid referencing the potential NULL
pointer. Similarly in the calling function ffs_func_bind(), move
the logging of the entry point to after checking of ffs_opts,
as only success indicates a valid ffs_data.

Change-Id: Id38ac1aadbd2e08f5be077e78569ec415c096e28
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 9c7152a7
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