summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Po <brucepo@google.com>2022-09-14 05:41:31 +0000
committerBruce Po <brucepo@google.com>2022-09-14 05:41:31 +0000
commitb1426f59b7504d4b51c213953b86f25899d61001 (patch)
treea422e570c58a380861a96f2c7b1e81f123a2c7b4
parentf85c0d4d19fa57b7c12795df89458ae5538343ae (diff)
downloadaoc-android-gs-pantah-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: I45a4bc85cb39c4d5d50324cdaa5d7e809f009d39
-rw-r--r--aoc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/aoc.c b/aoc.c
index 33f30c8..7bb553a 100644
--- a/aoc.c
+++ b/aoc.c
@@ -1039,7 +1039,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;
@@ -1200,7 +1200,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;