BigW Consortium Gitlab

Commit 6bdae894 by David Frey Committed by David Clark

mt7697q: Eliminate potential leak of work queue

The work queue would have been leaked in the case where the GPIO request failed because the error handling cases were in the wrong order.
parent aefd9aa0
......@@ -186,12 +186,12 @@ static int __init mt7697spi_init(void)
dev_info(qinfo->dev, "%s(): '%s' initialized\n", __func__, DRVNAME);
return 0;
failed_workqueue:
destroy_workqueue(qinfo->irq_workq);
failed_gpio_req:
if (qinfo->gpio_pin > 0) gpio_free(qinfo->gpio_pin);
failed_workqueue:
destroy_workqueue(qinfo->irq_workq);
cleanup:
if (qinfo) kfree(qinfo);
return ret;
......
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