fbdev: arkfb: Cast ics5342_init() allocation type
authorKees Cook <kees@kernel.org>
Sat, 26 Apr 2025 06:23:06 +0000 (23:23 -0700)
committerHelge Deller <deller@gmx.de>
Sat, 31 May 2025 08:24:02 +0000 (10:24 +0200)
commitede481f6dad47d40b7e561cfbc6c04286a9faf1a
tree4601133290199613faeaea8f1de678a17d82878d
parent34fe05cd2d0f4cc625afb656469a9838f02ca59e
fbdev: arkfb: Cast ics5342_init() allocation type

In preparation for making the kmalloc family of allocators type aware,
we need to make sure that the returned type from the allocation matches
the type of the variable being assigned. (Before, the allocator would
always return "void *", which can be implicitly cast to any pointer type.)

The assigned type is "struct dac_info *" but the returned type will be
"struct ics5342_info *", which has a larger allocation size. This is
by design, as struct ics5342_info contains struct dac_info as its first
member.
(patch slightly modified by Helge Deller)

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/arkfb.c