[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
2 changed files with 2 additions and 0 deletions
|
@ -414,6 +414,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
|
||||||
data_buf = memdup_user(buf, n_bytes);
|
data_buf = memdup_user(buf, n_bytes);
|
||||||
if (IS_ERR(data_buf)) {
|
if (IS_ERR(data_buf)) {
|
||||||
retval = PTR_ERR(data_buf);
|
retval = PTR_ERR(data_buf);
|
||||||
|
data_buf = NULL;
|
||||||
goto exit;
|
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);
|
data_buf = memdup_user((void const __user *)buf, n_bytes);
|
||||||
if (IS_ERR(data_buf)) {
|
if (IS_ERR(data_buf)) {
|
||||||
retval = PTR_ERR(data_buf);
|
retval = PTR_ERR(data_buf);
|
||||||
|
data_buf = NULL;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue