Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7644d8cc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qbt1000: Initialize drvdata structure before usage"

parents bb499534 dcd0a696
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -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)) ||
@@ -803,14 +804,16 @@ static long qbt1000_ioctl(struct file *file, unsigned cmd, unsigned long arg)
			}
		}

		app.name[MAX_NAME_SIZE - 1] = '\0';

		/* start the TZ app */
		rc = qseecom_start_app(&drvdata->app_handle,
				app.name, app.size);
		if (rc == 0) {
			g_app_buf_size = app.size;
		} else {
			dev_err(drvdata->dev, "%s: App %s failed to load\n",
				__func__, app.name);
			dev_err(drvdata->dev, "%s: Fingerprint Trusted App failed to load\n",
				__func__);
			goto end;
		}