You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usb: typec: altmodes/displayport: create sysfs nodes as driver's default device attribute group
commit 165376f upstream.
The DisplayPort driver's sysfs nodes may be present to the userspace before
typec_altmode_set_drvdata() completes in dp_altmode_probe. This means that
a sysfs read can trigger a NULL pointer error by deferencing dp->hpd in
hpd_show or dp->lock in pin_assignment_show, as dev_get_drvdata() returns
NULL in those cases.
Remove manual sysfs node creation in favor of adding attribute group as
default for devices bound to the driver. The ATTRIBUTE_GROUPS() macro is
not used here otherwise the path to the sysfs nodes is no longer compliant
with the ABI.
Fixes: 0e3bb7d ("usb: typec: Add driver for DisplayPort alternate mode")
Cc: [email protected]
Signed-off-by: RD Babiera <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[Minor conflict resolved due to code context change.]
Signed-off-by: Jianqi Ren <[email protected]>
Signed-off-by: He Zhe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 9794ffd9d0c39ee070fbd733f862bbe89b28ba33)
Signed-off-by: Vijayendra Suman <[email protected]>
0 commit comments