The buffer is allocated with the size of pointer and copy with the size of
data structure. Then trigger the system memory page fault. Use the
orignal data structure to get the object size.
Fixes: 3a00c04212d1 ("drm/amd/display/dc/core/dc_link: Move some local data from the stack to the heap")
Signed-off-by: Huang Rui <[email protected]>
Cc: Lee Jones <[email protected]>
Reviewed-by: Jinzhou.Su <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
DC_LOGGER_INIT(dc_ctx->logger);
- info = kzalloc(sizeof(info), GFP_KERNEL);
+ info = kzalloc(sizeof(struct integrated_info), GFP_KERNEL);
if (!info)
goto create_fail;
}
if (bios->integrated_info)
- memcpy(info, bios->integrated_info, sizeof(*info));
+ memcpy(info, bios->integrated_info, sizeof(struct integrated_info));
/* Look for channel mapping corresponding to connector and device tag */
for (i = 0; i < MAX_NUMBER_OF_EXT_DISPLAY_PATH; i++) {