zlogger: improve initialization 63/280463/5
authorMateusz Majewski <m.majewski2@samsung.com>
Tue, 30 Aug 2022 09:55:00 +0000 (11:55 +0200)
committerMateusz Majewski <m.majewski2@samsung.com>
Wed, 31 Aug 2022 08:12:57 +0000 (10:12 +0200)
commit37bf37e9868ea641cf7e282e0eab12dda70642e4
treef293019649302555d2564d0212ccedd410098ae7
parentfc387d273a45f2ddf6cde18441857532ab2fc26b
zlogger: improve initialization

The original code used an incorrect order of initialization. It's
important to first initialize the module variables, and only afterwards
initialize the device. Otherwise, userspace might access the device
before it is ready.

Additionally, some missing failure handling is added.

Change-Id: I8c907b92c5c45568e44fdbb0e645e0b593fb898c
Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
kernel/zlogger/zlogger.c