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

Commit 6a372165 authored by Fei Mao's avatar Fei Mao
Browse files

input: touchscreen: st: Fix some issues



Correct checking the proper regulator devices. Also, when
allocation of all_strbuff fails, return immediately thereby
fixing a NULL pointer access.

Change-Id: I47c980bc5491c569141c1f1b6b02c8582ddb056e
Signed-off-by: default avatarFei Mao <feim1@codeaurora.org>
parent 83be01dc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2450,6 +2450,8 @@ static ssize_t fts_stm_cmd_show(struct device *dev,
	/*here start the reporting phase,*/
	/* assembling the data to send in the file node */
	all_strbuff = kmalloc(size, GFP_KERNEL);
	if (!all_strbuff)
		return 0;
	memset(all_strbuff, 0, size);

	snprintf(buff, sizeof(buff), "%02X", 0xAA);
@@ -4049,14 +4051,14 @@ static int fts_chip_power_switch(struct fts_ts_info *info, bool on)
	}

	if (on) {
		if (info->pwr_reg) {
		if (info->bus_reg) {
			error = regulator_enable(info->bus_reg);
			if (error < 0)
				logError(1, "%s %s: Failed to enable AVDD\n",
					tag, __func__);
		}

		if (info->bus_reg) {
		if (info->pwr_reg) {
			error = regulator_enable(info->pwr_reg);
			if (error < 0)
				logError(1, "%s %s: Failed to enable DVDD\n",