]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf3ed38a3fc6db53d44e68b948f68b19af6c1ef5c
tree650bb3cd4f3af2d39c0a9b3c3210e3cef18a05bb
parent40661fe3ffe02cfa68576bf42e63dabb08ba4dcb
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