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)
committerJiri Slaby <jslaby@suse.cz>
Fri, 19 Aug 2016 07:51:24 +0000 (09:51 +0200)
commit31b0fca8ab9b9786fe6e5027c4a8587b47db5abf
treea81b168a20f2c8528bbc004bb48a42afe6cc8a01
parent15e2394c461a9e441b37a1a0ee94a9c8b8c9f95c
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: Jiri Slaby <jslaby@suse.cz>
drivers/mtd/ubi/build.c