Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5eb0daa8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Check snapshot objs size before saving to memory"

parents e5a65e4d 8fd74cd8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1296,6 +1296,11 @@ static void kgsl_snapshot_save_frozen_objs(struct work_struct *work)
	if (size == 0)
		goto done;

	if (size > device->snapshot_memory.size) {
		SNAPSHOT_ERR_NOMEM(device, "OBJS");
		goto done;
	}

	snapshot->mempool = vmalloc(size);

	ptr = snapshot->mempool;