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

Commit 363d3be9 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: adsprpc: Remove warning and fix logged kernel memory address



I came in to fix these warnings:

drivers/char/adsprpc.c: In function 'dma_alloc_memory':
drivers/char/adsprpc.c:632:36: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

drivers/char/adsprpc.c: In function 'fastrpc_buf_alloc':
drivers/char/adsprpc.c:976:35: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

But then I discovered that this was leaking a kernel memory address by
accident so fix the warning by changing the printk format to %pK in two spots.

Fixes: d5c40c85 ("msm: adsprpc: add fastrpc driver files")
Change-Id: Ic0dedbad8ffbeaa28e56f1f2f968747cb82b518e
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 8e9e84be
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 */
#include <linux/dma-buf.h>
#include <linux/dma-mapping.h>
@@ -628,8 +628,8 @@ static int dma_alloc_memory(dma_addr_t *region_phys, void **vaddr, size_t size,
	*vaddr = dma_alloc_attrs(me->dev, size, region_phys,
					GFP_KERNEL, dma_attr);
	if (IS_ERR_OR_NULL(*vaddr)) {
		pr_err("adsprpc: %s: %s: dma_alloc_attrs failed for size 0x%zx, returned %d\n",
				current->comm, __func__, size, (int)(*vaddr));
		pr_err("adsprpc: %s: %s: dma_alloc_attrs failed for size 0x%zx, returned %pK\n",
				current->comm, __func__, size, (*vaddr));
		return -ENOMEM;
	}
	return 0;
@@ -972,8 +972,8 @@ static int fastrpc_buf_alloc(struct fastrpc_file *fl, size_t size,
	}
	if (err) {
		err = -ENOMEM;
		pr_err("adsprpc: %s: %s: dma_alloc_attrs failed for size 0x%zx, returned %d\n",
			current->comm, __func__, size, (int)buf->virt);
		pr_err("adsprpc: %s: %s: dma_alloc_attrs failed for size 0x%zx, returned %pK\n",
			current->comm, __func__, size, buf->virt);
		goto bail;
	}
	if (fl->sctx->smmu.cb)