ubi: Fix race condition between ubi device creation and udev
authorIosif Harutyunov <iharutyunov@SonicWALL.com>
Fri, 22 Jul 2016 23:22:42 +0000 (23:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2016 16:09:26 +0000 (18:09 +0200)
commit4056337b1e81a1b137aa562133dc5430cd2fd19e
tree2f8d9256d704a22a358779cb55764cff3c863525
parent79d6bc128c0b3370acbfedf7da44e64678c25c27
ubi: Fix race condition between ubi device creation and udev

commit 714fb87e8bc05ff78255afc0dca981e8c5242785 upstream.

Install the UBI device object before we arm sysfs.
Otherwise udev tries to read sysfs attributes before UBI is ready and
udev rules will not match.

Signed-off-by: Iosif Harutyunov <iharutyunov@sonicwall.com>
[rw: massaged commit message]
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/ubi/build.c