mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-25 00:20:12 +07:00
[media] staging: lirc: freeing ERR_PTRs
We call kfree(data_buf) in the error handling and that will oops if this is an error pointer. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
fb91bde9d3
commit
3232e04df7
@ -414,6 +414,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
|
||||
data_buf = memdup_user(buf, n_bytes);
|
||||
if (IS_ERR(data_buf)) {
|
||||
retval = PTR_ERR(data_buf);
|
||||
data_buf = NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -392,6 +392,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
|
||||
data_buf = memdup_user((void const __user *)buf, n_bytes);
|
||||
if (IS_ERR(data_buf)) {
|
||||
retval = PTR_ERR(data_buf);
|
||||
data_buf = NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user