aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/most/mostcore
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2015-12-22 10:52:53 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 17:34:58 -0800
commit42e252a65d3bbd36106b3e243cb1e11136cecdf4 (patch)
treeb2bfd31caf4ba8deb8f50e302db3844c3083121d /drivers/staging/most/mostcore
parentstaging: most: move call to disconnect_channel callback (diff)
downloadlinux-dev-42e252a65d3bbd36106b3e243cb1e11136cecdf4.tar.xz
linux-dev-42e252a65d3bbd36106b3e243cb1e11136cecdf4.zip
staging: most: move initialization of pointer
This patch makes function store_add_link initialize the pointer to an AIM right before the channel is probed. It is needed, the AIM may already call most_start_channel while probe_channel is still running. At this point the pointer to the AIM must not be NULL. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most/mostcore')
-rw-r--r--drivers/staging/most/mostcore/core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index d5ef61df1f9b..21c550ccfe78 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -996,11 +996,14 @@ static ssize_t store_add_link(struct most_aim_obj *aim_obj,
else
return -ENOSPC;
+ *aim_ptr = aim_obj->driver;
ret = aim_obj->driver->probe_channel(c->iface, c->channel_id,
&c->cfg, &c->kobj, mdev_devnod);
- if (ret)
+ if (ret) {
+ *aim_ptr = NULL;
return ret;
- *aim_ptr = aim_obj->driver;
+ }
+
return len;
}