diff options
author | Joel Stanley <joel@jms.id.au> | 2022-02-17 13:39:23 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2022-02-17 13:39:32 +0300 |
commit | 2befcc6bb0bb1e0a4a31391a359adcab3925b6e4 (patch) | |
tree | acc6a7f8231c44844aac6c304e79c6d2de0a601a /drivers/misc | |
parent | fb55a38ae174af9f4ae45d9933dc9503356cfc38 (diff) | |
parent | a0ebea480bb319a3ad408c99db91262dbc696b76 (diff) | |
download | linux-2befcc6bb0bb1e0a4a31391a359adcab3925b6e4.tar.xz |
Merge tag 'v5.15.24' into dev-5.15
This is the 5.15.24 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/eeprom/ee1004.c | 3 | ||||
-rw-r--r-- | drivers/misc/fastrpc.c | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/misc/eeprom/ee1004.c b/drivers/misc/eeprom/ee1004.c index bb9c4512c968..9fbfe784d710 100644 --- a/drivers/misc/eeprom/ee1004.c +++ b/drivers/misc/eeprom/ee1004.c @@ -114,6 +114,9 @@ static ssize_t ee1004_eeprom_read(struct i2c_client *client, char *buf, if (offset + count > EE1004_PAGE_SIZE) count = EE1004_PAGE_SIZE - offset; + if (count > I2C_SMBUS_BLOCK_MAX) + count = I2C_SMBUS_BLOCK_MAX; + return i2c_smbus_read_i2c_block_data_or_emulated(client, offset, count, buf); } diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index f3002653bd01..86d8fb8c0148 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1286,7 +1286,14 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *fl, char __user *argp) } if (copy_to_user(argp, &bp, sizeof(bp))) { - dma_buf_put(buf->dmabuf); + /* + * The usercopy failed, but we can't do much about it, as + * dma_buf_fd() already called fd_install() and made the + * file descriptor accessible for the current process. It + * might already be closed and dmabuf no longer valid when + * we reach this point. Therefore "leak" the fd and rely on + * the process exit path to do any required cleanup. + */ return -EFAULT; } |