Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions Documentation/devicetree/bindings/input/touchscreen/msg21xx-ts.txt

This file was deleted.

3 changes: 2 additions & 1 deletion arch/arm64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ static const char *compat_hwcap_str[] = {
"idivt",
"vfpd32",
"lpae",
"evtstrm"
"evtstrm",
NULL
};
#endif /* CONFIG_COMPAT */

Expand Down
3 changes: 3 additions & 0 deletions drivers/base/dma-contiguous.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@ unsigned long dma_alloc_from_contiguous(struct device *dev, size_t count,
if (!count)
return 0;

if (count > cma->count)
return 0;

mask = (1 << align) - 1;


Expand Down
23 changes: 19 additions & 4 deletions drivers/char/adsprpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ static int context_build_overlap(struct smq_invoke_ctx *ctx)
for (i = 0; i < nbufs; ++i) {
ctx->overs[i].start = (uintptr_t)pra[i].buf.pv;
ctx->overs[i].end = ctx->overs[i].start + pra[i].buf.len;
if (pra[i].buf.len) {
VERIFY(err, ctx->overs[i].end > ctx->overs[i].start);
if (err)
goto bail;
}
ctx->overs[i].raix = i;
ctx->overps[i] = &ctx->overs[i];
}
Expand Down Expand Up @@ -835,9 +840,9 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx,
void *args;
remote_arg_t *pra = ctx->pra;
remote_arg_t *rpra = ctx->rpra;
ssize_t rlen, used, size;
ssize_t rlen, used, size, copylen = 0;
uint32_t sc = ctx->sc, start;
int i, inh, bufs = 0, err = 0, oix, copylen = 0;
int i, inh, bufs = 0, err = 0, oix;
int inbufs = REMOTE_SCALARS_INBUFS(sc);
int outbufs = REMOTE_SCALARS_OUTBUFS(sc);
int cid = ctx->fdata->cid;
Expand Down Expand Up @@ -886,13 +891,23 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx,
/* calculate len requreed for copying */
for (oix = 0; oix < inbufs + outbufs; ++oix) {
int i = ctx->overps[oix]->raix;
uintptr_t mstart, mend;

if (!pra[i].buf.len)
continue;
if (list[i].num)
continue;
if (ctx->overps[oix]->offset == 0)
copylen = ALIGN(copylen, BALIGN);
copylen += ctx->overps[oix]->mend - ctx->overps[oix]->mstart;
mstart = ctx->overps[oix]->mstart;
mend = ctx->overps[oix]->mend;
VERIFY(err, (mend - mstart) <= LONG_MAX);
if (err)
goto bail;
copylen += mend - mstart;
VERIFY(err, copylen >= 0);
if (err)
goto bail;
}

/* alocate new buffer */
Expand All @@ -918,7 +933,7 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx,
/* copy non ion buffers */
for (oix = 0; oix < inbufs + outbufs; ++oix) {
int i = ctx->overps[oix]->raix;
int mlen = ctx->overps[oix]->mend - ctx->overps[oix]->mstart;
ssize_t mlen = ctx->overps[oix]->mend - ctx->overps[oix]->mstart;
if (!pra[i].buf.len)
continue;
if (list[i].num)
Expand Down
6 changes: 3 additions & 3 deletions drivers/crypto/msm/ota_crypto.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-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
Expand Down Expand Up @@ -880,8 +880,8 @@ static ssize_t _debug_stats_read(struct file *file, char __user *buf,
int len;

len = _disp_stats();

rc = simple_read_from_buffer((void __user *) buf, len,
if (len <= count)
rc = simple_read_from_buffer((void __user *) buf, len,
ppos, (void *) _debug_read_buf, len);

return rc;
Expand Down
15 changes: 12 additions & 3 deletions drivers/crypto/msm/qcedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,15 @@ static int qcedev_check_cipher_params(struct qcedev_cipher_op_req *req,
pr_err("%s: Invalid byte offset\n", __func__);
goto error;
}
total = req->byteoffset;
for (i = 0; i < req->entries; i++) {
if (total > U32_MAX - req->vbuf.src[i].len) {
pr_err("%s:Integer overflow on total src len\n",
__func__);
goto error;
}
total += req->vbuf.src[i].len;
}
}

if (req->data_len < req->byteoffset) {
Expand Down Expand Up @@ -1491,7 +1500,7 @@ static int qcedev_check_cipher_params(struct qcedev_cipher_op_req *req,
}
}
/* Check for sum of all dst length is equal to data_len */
for (i = 0; i < req->entries; i++) {
for (i = 0, total = 0; i < req->entries; i++) {
if (req->vbuf.dst[i].len >= U32_MAX - total) {
pr_err("%s: Integer overflow on total req dst vbuf length\n",
__func__);
Expand Down Expand Up @@ -2052,9 +2061,9 @@ static ssize_t _debug_stats_read(struct file *file, char __user *buf,

len = _disp_stats(qcedev);

rc = simple_read_from_buffer((void __user *) buf, len,
if (len <= count)
rc = simple_read_from_buffer((void __user *) buf, len,
ppos, (void *) _debug_read_buf, len);

return rc;
}

Expand Down
6 changes: 3 additions & 3 deletions drivers/crypto/msm/qcrypto.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Qualcomm Crypto driver
*
* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
* Copyright (c) 2010-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
Expand Down Expand Up @@ -5052,9 +5052,9 @@ static ssize_t _debug_stats_read(struct file *file, char __user *buf,

len = _disp_stats(qcrypto);

rc = simple_read_from_buffer((void __user *) buf, len,
if (len <= count)
rc = simple_read_from_buffer((void __user *) buf, len,
ppos, (void *) _debug_read_buf, len);

return rc;
}

Expand Down
8 changes: 6 additions & 2 deletions drivers/input/misc/hbtp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ static int hbtp_input_create_input_dev(struct hbtp_input_absinfo *absinfo)
input_mt_init_slots(input_dev, HBTP_MAX_FINGER, 0);
for (i = 0; i <= ABS_MT_LAST - ABS_MT_FIRST; i++) {
abs = absinfo + i;
if (abs->active)
input_set_abs_params(input_dev, abs->code,
if (abs->active) {
if (abs->code >= 0 && abs->code < ABS_CNT)
input_set_abs_params(input_dev, abs->code,
abs->minimum, abs->maximum, 0, 0);
else
pr_err("%s: ABS code out of bound\n", __func__);
}
}

error = input_register_device(input_dev);
Expand Down
17 changes: 8 additions & 9 deletions drivers/input/touchscreen/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -955,16 +955,15 @@ config TOUCHSCREEN_FT5X06_GESTURE

If unsure, say N.

config TOUCHSCREEN_MSTAR21XX
tristate "mstar touchscreens"
depends on I2C
help
Say Y here if you have a mstar touchscreen.

If unsure, say N.
config TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
bool "Synaptics DSX firmware update extra sysfs attributes"
depends on TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE
help
Say Y here to enable support for extra sysfs attributes
supporting firmware update in a development environment.
This does not affect the core or other subsystem attributes.

To compile this driver as a module, choose M here: the
module will be called msg21xx_ts.
If unsure, say N.

config TOUCHSCREEN_GEN_VKEYS
tristate "Touchscreen Virtual Keys Driver"
Expand Down
1 change: 0 additions & 1 deletion drivers/input/touchscreen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o
obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o
obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
obj-$(CONFIG_TOUCHSCREEN_FT5X06) += ft5x06_ts.o
obj-$(CONFIG_TOUCHSCREEN_MSTAR21XX) += msg21xx_ts.o
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_RMI4_DEV) += synaptics_rmi_dev.o
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE) += synaptics_fw_update.o
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += synaptics_i2c_rmi4.o
Expand Down
8 changes: 7 additions & 1 deletion drivers/input/touchscreen/gt9xx/goodix_tool.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* drivers/input/touchscreen/goodix_tool.c
*
* 2010 - 2012 Goodix Technology.
* Copyright (c) 2013, The Linux Foundation. All rights reserved.
* Copyright (c) 2013-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 as published by
Expand Down Expand Up @@ -311,6 +311,7 @@ static s32 goodix_tool_write(struct file *filp, const char __user *userbuf,
size_t count, loff_t *ppos)
{
s32 ret = 0;
u8 *dataptr = NULL;

mutex_lock(&lock);
ret = copy_from_user(&cmd_head, userbuf, CMD_HEAD_LENGTH);
Expand Down Expand Up @@ -463,6 +464,11 @@ static s32 goodix_tool_write(struct file *filp, const char __user *userbuf,
ret = CMD_HEAD_LENGTH;

exit:
dataptr = cmd_head.data;
memset(&cmd_head, 0, sizeof(cmd_head));
cmd_head.wr = 0xFF;
cmd_head.data = dataptr;

mutex_unlock(&lock);
return ret;
}
Expand Down
Loading