summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Po <brucepo@google.com>2022-09-13 23:27:24 +0000
committerBruce Po <brucepo@google.com>2022-09-13 23:27:24 +0000
commit827ddf40a63fa4ea0f7c997321a12a15fcf6f8f2 (patch)
tree870addfd4516238903ea348799724549e0dc34b7
parent921e27a890fc1ce49f7e7132ea9be88ba56ff1b6 (diff)
downloadaoc-android-gs-raviole-5.10-android13-qpr1-beta-3.tar.gz
aoc_service_read_timeout() and aoc_service_write_timeout() should get the platform_device using aoc_service_dev.parent rather than the global pointer aoc_platform_device. This is more correct and avoids pointer corruption issue (still being investigated). BUG: 245657964 Signed-off-by: brucepo@google.com Change-Id: I10031331db38aed60da503ecbdc95d89baf7fb88
-rw-r--r--aoc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/aoc.c b/aoc.c
index 5cb65ba..153745a 100644
--- a/aoc.c
+++ b/aoc.c
@@ -1024,7 +1024,7 @@ ssize_t aoc_service_read_timeout(struct aoc_service_dev *dev, uint8_t *buffer,
if (!aoc_platform_device)
return -ENODEV;
- prvdata = platform_get_drvdata(aoc_platform_device);
+ prvdata = dev_get_drvdata(dev->dev.parent);
if (!prvdata)
return -ENODEV;
@@ -1185,7 +1185,7 @@ ssize_t aoc_service_write_timeout(struct aoc_service_dev *dev, const uint8_t *bu
if (!aoc_platform_device)
return -ENODEV;
- prvdata = platform_get_drvdata(aoc_platform_device);
+ prvdata = dev_get_drvdata(dev->dev.parent);
if (!prvdata)
return -ENODEV;