mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
mhi: dev: netdev: Update logic for valid access of dentry variable
Variable "dentry" is valid only if "CONFIG_DEBUG_FS" is set. Update logic such that "dentry" variable is accessed during debugfs removal only in valid condition. Change-Id: I2a1e3e7f312cf316c94e930e15e9528fbeedb9a1 Signed-off-by: Nitesh Gupta <nitegupt@codeaurora.org>
This commit is contained in:
parent
9efe49ec3a
commit
562e6c175b
1 changed files with 11 additions and 3 deletions
|
|
@ -918,9 +918,14 @@ static void mhi_netdev_create_debugfs_dir(void)
|
|||
dentry = debugfs_create_dir(MHI_NETDEV_DRIVER_NAME, 0);
|
||||
}
|
||||
|
||||
static void mhi_netdev_debugfs_remove(void)
|
||||
{
|
||||
debugfs_remove_recursive(dentry);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void mhi_netdev_create_debugfs(struct mhi_netdev_private *mhi_netdev)
|
||||
static void mhi_netdev_create_debugfs(struct mhi_netdev *mhi_netdev)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -928,6 +933,10 @@ static void mhi_netdev_create_debugfs_dir(void)
|
|||
{
|
||||
}
|
||||
|
||||
static void mhi_netdev_debugfs_remove(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void mhi_netdev_remove(struct mhi_device *mhi_dev)
|
||||
|
|
@ -1141,8 +1150,7 @@ module_init(mhi_netdev_init);
|
|||
|
||||
static void __exit mhi_netdev_exit(void)
|
||||
{
|
||||
debugfs_remove_recursive(dentry);
|
||||
|
||||
mhi_netdev_debugfs_remove();
|
||||
mhi_driver_unregister(&mhi_netdev_driver);
|
||||
}
|
||||
module_exit(mhi_netdev_exit);
|
||||
|
|
|
|||
Loading…
Reference in a new issue