summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavid Emamdoost <navid.emamdoost@gmail.com>2019-09-11 23:10:59 +0300
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-09-12 17:20:54 +0300
commit4c1fde5077dcad1a2a10a6a0883c8f94326c4971 (patch)
tree74b1d5af3c5131f7edc476d238946b4c8644cd8d
parent96a0a80738461d6d2421ae64ee9990b702efd2a6 (diff)
downloadlinux-4c1fde5077dcad1a2a10a6a0883c8f94326c4971.tar.xz
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>
-rw-r--r--drivers/platform/chrome/cros_usbpd_logger.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_usbpd_logger.c b/drivers/platform/chrome/cros_usbpd_logger.c
index c549a9b49b56..2430e8b82810 100644
--- a/drivers/platform/chrome/cros_usbpd_logger.c
+++ b/drivers/platform/chrome/cros_usbpd_logger.c
@@ -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);