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

Skip to content
Commit 2a2a7734 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: dwc3: Check return value for debugfs_create_dir()



debugfs_create_dir() returns NULL when second directory is created
with same name gsi-epin. Without checking return value
dwc3_debugfs_create_endpoint_dir() creates endpoint files with parent
as NULL. This would create files in root dir /sys/kernel/debug which
remains there even after calling debugfs_remove_recursive() from
dwc3_debugfs_exit(). Due to probe deferral dwc3 endpoints get freed
up and re-allocated. As a result accessing endpoint files created in
root dir causes access to stale dwc3 endpoint pointer. Hence check
return value for debugfs_create_dir and do not create files for NULL
parent.

Change-Id: I44b65b77f35be1a52e71db2184a359887c25c8c9
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 22b95ff5
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