summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-09-16 21:37:11 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-09-16 21:37:11 +0300
commitcce67b6bedd3e28939446508ebd94d91305b8ace (patch)
treed62f1e85914d1fc30fc51df0a5b3079495f2f1d6 /drivers
parent205d0494782ff7062afedf8945c085b49ccada7d (diff)
parentf26a679ed799deef9e2934a6b60b8f38bdbf4921 (diff)
downloadlinux-cce67b6bedd3e28939446508ebd94d91305b8ace.tar.xz
Merge tag 'usb-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fix from Greg KH: "Here is a single USB fix for a much-reported regression for 6.6-rc1. It resolves a crash in the typec debugfs code for many systems. It's been in linux-next with no reported issues, and many people have reported it resolving their problem with 6.6-rc1" * tag 'usb-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: typec: ucsi: Fix NULL pointer dereference
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/typec/ucsi/debugfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/typec/ucsi/debugfs.c b/drivers/usb/typec/ucsi/debugfs.c
index 0c7bf88d4a7f..f67733cecfdf 100644
--- a/drivers/usb/typec/ucsi/debugfs.c
+++ b/drivers/usb/typec/ucsi/debugfs.c
@@ -84,6 +84,9 @@ void ucsi_debugfs_register(struct ucsi *ucsi)
void ucsi_debugfs_unregister(struct ucsi *ucsi)
{
+ if (IS_ERR_OR_NULL(ucsi) || !ucsi->debugfs)
+ return;
+
debugfs_remove_recursive(ucsi->debugfs->dentry);
kfree(ucsi->debugfs);
}