From dcd0a696c33dd3ab824151833d787f3ff90abbba Mon Sep 17 00:00:00 2001 From: Abir Ghosh Date: Tue, 11 Apr 2017 10:10:23 +0530 Subject: qbt1000: Initialize drvdata structure before usage Fix uninitialized local variable error which might have lead to crash Change-Id: I3fd95cb343c3175e4190c8ebfe209399db0602a6 CRs-Fixed: 2030137 Signed-off-by: Abir Ghosh --- 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 b24978c..7f99c86 100644 --- a/drivers/soc/qcom/qbt1000.c +++ b/drivers/soc/qcom/qbt1000.c @@ -753,13 +753,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)) || -- cgit v1.1