Commit 3232e04d authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab

[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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent fb91bde9
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment