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

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

Merge "ASoC: qdsp6v2: handle ion alloc failure correctly"

parents 7fbe67b4 5903be5d
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2015, 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
@@ -47,6 +47,7 @@ int msm_audio_ion_alloc(const char *name, struct ion_client **client,
			ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr)
{
	int rc = -EINVAL;
	unsigned long err_ion_ptr = 0;

	if ((msm_audio_ion_data.smmu_enabled == true) &&
	    (msm_audio_ion_data.group == NULL)) {
@@ -74,12 +75,11 @@ int msm_audio_ion_alloc(const char *name, struct ion_client **client,
					ION_HEAP(ION_SYSTEM_HEAP_ID), 0);
		}
		if (IS_ERR_OR_NULL((void *) (*handle))) {
			if ((void *)(*handle) != NULL)
				rc = *(int *)(*handle);
			else
			if (IS_ERR((void *)(*handle)))
				err_ion_ptr = PTR_ERR((int *)(*handle));
			pr_err("%s:ION alloc fail err ptr=%ld, smmu_enabled=%d\n",
			__func__, err_ion_ptr, msm_audio_ion_data.smmu_enabled);
			rc = -ENOMEM;
			pr_err("%s:ION mem alloc fail rc=%d, smmu_enabled=%d\n",
				__func__, rc, msm_audio_ion_data.smmu_enabled);
			goto err_ion_client;
		}
	} else {