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

Commit b73f09a5 authored by Vaishnavi Kommaraju's avatar Vaishnavi Kommaraju
Browse files

dsp: Update return value when ion_map_kernel fails



In ion_alloc, return value is not updated when ion_map_kernel fails.
This leads to access of invalid memory on failure.
Update return value in failure case to fix this.

Change-Id: Ib32a400a5fe9498f45ba0586978fe9ee3a6d827a
Signed-off-by: default avatarVaishnavi Kommaraju <vkommara@codeaurora.org>
parent e0d8f6a8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2018, 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
@@ -158,6 +158,7 @@ int msm_audio_ion_alloc(const char *name, struct ion_client **client,
	*vaddr = ion_map_kernel(*client, *handle);
	if (IS_ERR_OR_NULL((void *)*vaddr)) {
		pr_err("%s: ION memory mapping for AUDIO failed\n", __func__);
		rc = -ENOMEM;
		goto err_ion_handle;
	}
	pr_debug("%s: mapped address = %pK, size=%zd\n", __func__,