diff options
author | Hans de Goede <hdegoede@redhat.com> | 2023-03-08 18:42:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-30 13:51:37 +0300 |
commit | 7ef0423e43f877a328454059d46763043ce3da44 (patch) | |
tree | c213dae193440fb6cb1178dd33d8ac1cc9c2cba9 /lib/notifier-error-inject.c | |
parent | 9060decc22a5eb5edd5f31b9a661d535a433715a (diff) | |
download | linux-7ef0423e43f877a328454059d46763043ce3da44.tar.xz |
usb: ucsi: Fix NULL pointer deref in ucsi_connector_change()
commit f87fb985452ab2083967103ac00bfd68fb182764 upstream.
When ucsi_init() fails, ucsi->connector is NULL, yet in case of
ucsi_acpi we may still get events which cause the ucs_acpi code to call
ucsi_connector_change(), which then derefs the NULL ucsi->connector
pointer.
Fix this by not setting ucsi->ntfy inside ucsi_init() until ucsi_init()
has succeeded, so that ucsi_connector_change() ignores the events
because UCSI_ENABLE_NTFY_CONNECTOR_CHANGE is not set in the ntfy mask.
Fixes: bdc62f2bae8f ("usb: typec: ucsi: Simplified registration and I/O API")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217106
Cc: stable@vger.kernel.org
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230308154244.722337-2-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions