OSDN Git Service

staging: most: register channel device after init of struct members
authorChristian Gromm <christian.gromm@microchip.com>
Mon, 13 Aug 2018 13:02:28 +0000 (15:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2018 17:51:49 +0000 (19:51 +0200)
commitf0b4a22a48481824e124f633bbe5d3e884fc8e36
tree650bb3cd4f3af2d39c0a9b3c3210e3cef18a05bb
parent23c41ca6173da88c4acff1e353af654085ee3a0d
staging: most: register channel device after init of struct members

This patch moves the call to device_register to the end of the channel
initialization section that the devcie belongs to. It is needed to
avoid NULL pointer dereferences once the device is registered with
sysfs.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/core.c