mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-22 06:04:57 -05:00
37 lines
1.2 KiB
Diff
37 lines
1.2 KiB
Diff
From b256cd87d50eede2dae6185fbe8828d7223db0d6 Mon Sep 17 00:00:00 2001
|
|
From: Abir Ghosh <abirg@codeaurora.org>
|
|
Date: Tue, 11 Apr 2017 10:10:23 +0530
|
|
Subject: [PATCH] qbt1000: Initialize drvdata structure before usage
|
|
|
|
Fix uninitialized local variable error which might have lead to
|
|
crash
|
|
|
|
Bug: 35764241
|
|
Change-Id: I3fd95cb343c3175e4190c8ebfe209399db0602a6
|
|
CRs-Fixed: 2030137
|
|
Signed-off-by: Abir Ghosh <abirg@codeaurora.org>
|
|
---
|
|
drivers/soc/qcom/qbt1000.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/soc/qcom/qbt1000.c b/drivers/soc/qcom/qbt1000.c
|
|
index f76cf0f45ecaa..bd6f0e6005f31 100755
|
|
--- a/drivers/soc/qcom/qbt1000.c
|
|
+++ b/drivers/soc/qcom/qbt1000.c
|
|
@@ -752,13 +752,14 @@ static long qbt1000_ioctl(struct file *file, unsigned cmd, unsigned long arg)
|
|
void __user *priv_arg = (void __user *)arg;
|
|
struct qbt1000_drvdata *drvdata;
|
|
|
|
+ drvdata = file->private_data;
|
|
+
|
|
if (IS_ERR(priv_arg)) {
|
|
dev_err(drvdata->dev, "%s: invalid user space pointer %lu\n",
|
|
__func__, arg);
|
|
return -EINVAL;
|
|
}
|
|
|
|
- drvdata = file->private_data;
|
|
pm_runtime_get_sync(drvdata->dev);
|
|
mutex_lock(&drvdata->mutex);
|
|
if (((drvdata->sensor_conn_type == SPI) && (!drvdata->clock_state)) ||
|