]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: serdev_helpers: Check for serial_ctrl_uid == NULL
authorHans de Goede <hdegoede@redhat.com>
Wed, 4 Dec 2024 20:42:14 +0000 (21:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2025 09:04:57 +0000 (10:04 +0100)
commit1c1c91bf05efe4872990cc9c2bdfab09c7e39709
tree558e5be0fbcfd44899c805a8686112105fdb0eca
parente46d91ca504d69ae3d09c120b162a238b8013890
platform/x86: serdev_helpers: Check for serial_ctrl_uid == NULL

commit 478b00a623d6c8ae23a1be7bcc96cb5497045cef upstream.

dell_uart_bl_pdev_probe() calls get_serdev_controller() with the
serial_ctrl_uid parameter set to NULL.

In case of errors this NULL parameter then gets passed to pr_err()
as argument matching a "%s" conversion specification. This leads to
compiler warnings when building with "make W=1".

Check serial_ctrl_uid before passing it to pr_err() to avoid these.

Fixes: dc5afd720f84 ("platform/x86: Add new get_serdev_controller() helper")
Cc: stable@vger.kernel.org
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20241204204227.95757-4-hdegoede@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/serdev_helpers.h