uio: msm_sharedmem: add pr_err in alloc memory failure

show err in alloc memory failure path of probe.

Change-Id: I2a68281edbecabc4ee7c6adcb30d2542664ceecc
Signed-off-by: Mao Wang <quic_maow@quicinc.com>
Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
This commit is contained in:
Kassey Li 2023-05-12 16:35:46 +08:00
parent 437e4addec
commit 52c72101a2

View File

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#define DRIVER_NAME "msm_sharedmem"
@ -168,8 +169,10 @@ static int msm_sharedmem_probe(struct platform_device *pdev)
shared_mem = dma_alloc_coherent(&pdev->dev, shared_mem_tot_sz,
&shared_mem_pyhsical, GFP_KERNEL);
if (shared_mem == NULL)
if (shared_mem == NULL) {
pr_err("failed to alloc memory %d\n", shared_mem_tot_sz);
return -ENOMEM;
}
if (guard_memory)
shared_mem_pyhsical += SZ_4K;
}