Commit 4c1fde50 authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Enric Balletbo i Serra

platform/chrome: cros_usbpd_logger: null check create_singlethread_workqueue

In cros_usbpd_logger_probe the return value of
create_singlethread_workqueue may be null, it should be checked.
Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
parent 96a0a807
...@@ -210,6 +210,9 @@ static int cros_usbpd_logger_probe(struct platform_device *pd) ...@@ -210,6 +210,9 @@ static int cros_usbpd_logger_probe(struct platform_device *pd)
/* Retrieve PD event logs periodically */ /* Retrieve PD event logs periodically */
INIT_DELAYED_WORK(&logger->log_work, cros_usbpd_log_check); INIT_DELAYED_WORK(&logger->log_work, cros_usbpd_log_check);
logger->log_workqueue = create_singlethread_workqueue("cros_usbpd_log"); logger->log_workqueue = create_singlethread_workqueue("cros_usbpd_log");
if (!logger->log_workqueue)
return -ENOMEM;
queue_delayed_work(logger->log_workqueue, &logger->log_work, queue_delayed_work(logger->log_workqueue, &logger->log_work,
CROS_USBPD_LOG_UPDATE_DELAY); CROS_USBPD_LOG_UPDATE_DELAY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment