net: neuron: channel: Move waitq init
Initialize the waitq before registering with the doorbell framework to prevent uninitialized variable access. Change-Id: Icb902b829a6af52716713b18891e4e35c0c2a620 Signed-off-by: Chris Lew <clew@codeaurora.org>
This commit is contained in:
parent
73db1046f1
commit
daa0f471a9
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2020 The Linux Foundation. All rights reserved. */
|
||||
/* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. */
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
@ -479,6 +479,7 @@ static int channel_hh_probe(struct neuron_channel *cdev)
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
priv->dev = cdev;
|
||||
init_waitqueue_head(&priv->wait_q);
|
||||
|
||||
ret = of_property_read_u32(node, "haven-label", &priv->haven_label);
|
||||
if (ret) {
|
||||
@ -507,8 +508,6 @@ static int channel_hh_probe(struct neuron_channel *cdev)
|
||||
dev_err(dev, "failed to get haven rx dbl %d\n", ret);
|
||||
goto fail_rx_dbl;
|
||||
}
|
||||
|
||||
init_waitqueue_head(&priv->wait_q);
|
||||
/* Start the thread for syncing with the sender. */
|
||||
priv->sync_thread = kthread_run(channel_sync_thread, priv,
|
||||
"recv_sync_thread");
|
||||
|
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2020 The Linux Foundation. All rights reserved. */
|
||||
/* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. */
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
@ -464,6 +464,7 @@ static int channel_hh_probe(struct neuron_channel *cdev)
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
priv->dev = cdev;
|
||||
init_waitqueue_head(&priv->wait_q);
|
||||
|
||||
ret = of_property_read_u32(node, "haven-label", &priv->haven_label);
|
||||
if (ret) {
|
||||
@ -490,8 +491,6 @@ static int channel_hh_probe(struct neuron_channel *cdev)
|
||||
dev_err(dev, "failed to get haven rx dbl %d\n", ret);
|
||||
goto fail_rx_dbl;
|
||||
}
|
||||
|
||||
init_waitqueue_head(&priv->wait_q);
|
||||
/* Start the thread for syncing with the receiver. */
|
||||
priv->sync_thread = kthread_run(channel_sync_thread, priv,
|
||||
"send_sync_thread");
|
||||
|
Loading…
Reference in New Issue
Block a user