fbdev: efifb: Register sysfs groups through driver core

commit 95cdd538e0e5677efbdf8aade04ec098ab98f457 upstream.

The driver core can register and cleanup sysfs groups already.
Make use of that functionality to simplify the error handling and
cleanup.

Also avoid a UAF race during unregistering where the sysctl attributes
were usable after the info struct was freed.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Link: https://nvd.nist.gov/vuln/detail/CVE-2024-49925
Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp>
1 file changed