Skip to content

Commit c216f12

Browse files
Igor Druzhininzhenyw
authored andcommitted
drm/i915/gvt: fix high-order allocation failure on late load
If the module happens to be loaded later at runtime there is a chance memory is already fragmented enough to fail allocation of firmware blob storage and consequently GVT init. Since it doesn't seem to be necessary to have the blob contiguous, use vmalloc() instead to avoid the issue. Reviewed-by: Zhenyu Wang <[email protected]> Signed-off-by: Igor Druzhinin <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5e822e4 commit c216f12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/gvt/firmware.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void intel_gvt_free_firmware(struct intel_gvt *gvt)
146146
clean_firmware_sysfs(gvt);
147147

148148
kfree(gvt->firmware.cfg_space);
149-
kfree(gvt->firmware.mmio);
149+
vfree(gvt->firmware.mmio);
150150
}
151151

152152
static int verify_firmware(struct intel_gvt *gvt,
@@ -229,7 +229,7 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt)
229229

230230
firmware->cfg_space = mem;
231231

232-
mem = kmalloc(info->mmio_size, GFP_KERNEL);
232+
mem = vmalloc(info->mmio_size);
233233
if (!mem) {
234234
kfree(path);
235235
kfree(firmware->cfg_space);

0 commit comments

Comments
 (0)