1
0
Fork 0

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: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
alistair/sunxi64-5.4-dsi
Navid Emamdoost 2019-09-11 15:10:59 -05:00 committed by Enric Balletbo i Serra
parent 96a0a80738
commit 4c1fde5077
1 changed files with 3 additions and 0 deletions

View File

@ -210,6 +210,9 @@ static int cros_usbpd_logger_probe(struct platform_device *pd)
/* Retrieve PD event logs periodically */
INIT_DELAYED_WORK(&logger->log_work, cros_usbpd_log_check);
logger->log_workqueue = create_singlethread_workqueue("cros_usbpd_log");
if (!logger->log_workqueue)
return -ENOMEM;
queue_delayed_work(logger->log_workqueue, &logger->log_work,
CROS_USBPD_LOG_UPDATE_DELAY);