linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] soc: qcom: geni: Provide parameter error checking
@ 2019-09-03 13:50 Lee Jones
  2019-09-04  3:19 ` Bjorn Andersson
  0 siblings, 1 reply; 11+ messages in thread
From: Lee Jones @ 2019-09-03 13:50 UTC (permalink / raw)
  To: agross
  Cc: linux-arm-kernel, linux-kernel, linux-arm-msm, bjorn.andersson,
	Lee Jones

When booting with ACPI, the Geni Serial Engine is not set as the I2C/SPI
parent and thus, the wrapper (parent device) is unassigned.  This causes
the kernel to crash with a null dereference error.

Fixes: 8bc529b25354 ("soc: qcom: geni: Add support for ACPI")
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
Since we are already at -rc7 this patch should be processed ASAP - thank you.

drivers/soc/qcom/qcom-geni-se.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
index d5cf953b4337..7d622ea1274e 100644
--- a/drivers/soc/qcom/qcom-geni-se.c
+++ b/drivers/soc/qcom/qcom-geni-se.c
@@ -630,6 +630,9 @@ int geni_se_tx_dma_prep(struct geni_se *se, void *buf, size_t len,
 	struct geni_wrapper *wrapper = se->wrapper;
 	u32 val;
 
+	if (!wrapper)
+		return -EINVAL;
+
 	*iova = dma_map_single(wrapper->dev, buf, len, DMA_TO_DEVICE);
 	if (dma_mapping_error(wrapper->dev, *iova))
 		return -EIO;
@@ -663,6 +666,9 @@ int geni_se_rx_dma_prep(struct geni_se *se, void *buf, size_t len,
 	struct geni_wrapper *wrapper = se->wrapper;
 	u32 val;
 
+	if (!wrapper)
+		return -EINVAL;
+
 	*iova = dma_map_single(wrapper->dev, buf, len, DMA_FROM_DEVICE);
 	if (dma_mapping_error(wrapper->dev, *iova))
 		return -EIO;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-09-05  7:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03 13:50 [PATCH 1/1] soc: qcom: geni: Provide parameter error checking Lee Jones
2019-09-04  3:19 ` Bjorn Andersson
2019-09-04  8:45   ` Lee Jones
2019-09-04 18:27     ` Bjorn Andersson
2019-09-04 20:01       ` Lee Jones
2019-09-04 20:26         ` Bjorn Andersson
2019-09-05  6:54           ` Lee Jones
2019-09-04 23:45       ` Stephen Boyd
2019-09-05  6:42         ` Lee Jones
2019-09-05  6:56           ` Stephen Boyd
2019-09-05  7:30             ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).