diff --git a/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c b/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c index 93c9c3c373b8..a9a835de9a1a 100644 --- a/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c +++ b/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c @@ -5,7 +5,7 @@ * * Copyright (C) 2012 Alexandra Chin * Copyright (C) 2012 Scott Lin - * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3808,6 +3808,13 @@ static int synaptics_rmi4_probe(struct platform_device *pdev) } exp_data.workqueue = create_singlethread_workqueue("dsx_exp_workqueue"); + if (exp_data.workqueue == NULL) { + dev_err(&pdev->dev, + "%s: Failed to create workqueue\n", __func__); + retval = -ENOMEM; + goto err_create_wq; + } + INIT_DELAYED_WORK(&exp_data.work, synaptics_rmi4_exp_fn_work); exp_data.rmi4_data = rmi4_data; exp_data.queue_work = true; @@ -3859,10 +3866,9 @@ err_create_debugfs_file: debugfs_remove_recursive(rmi4_data->dir); err_create_debugfs_dir: cancel_delayed_work_sync(&exp_data.work); - if (exp_data.workqueue != NULL) { - flush_workqueue(exp_data.workqueue); - destroy_workqueue(exp_data.workqueue); - } + flush_workqueue(exp_data.workqueue); + destroy_workqueue(exp_data.workqueue); +err_create_wq: synaptics_rmi4_irq_enable(rmi4_data, false); free_irq(rmi4_data->irq, rmi4_data);