diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-09-04 08:10:05 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-23 16:13:36 -0300 |
commit | 3232e04df7224f31a31cfe927096f3d03ba743ab (patch) | |
tree | dc290f5e60e868b66c12334c49c5bb8e4e04b4b9 /drivers/staging | |
parent | fb91bde9d3664dd879655f3a1013c0b5728e7a09 (diff) | |
download | op-kernel-dev-3232e04df7224f31a31cfe927096f3d03ba743ab.zip op-kernel-dev-3232e04df7224f31a31cfe927096f3d03ba743ab.tar.gz |
[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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/lirc/lirc_imon.c | 1 | ||||
-rw-r--r-- | drivers/staging/media/lirc/lirc_sasem.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index 96c76b3..5441f40 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c @@ -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; } diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c index 81f90e1..c32e296 100644 --- a/drivers/staging/media/lirc/lirc_sasem.c +++ b/drivers/staging/media/lirc/lirc_sasem.c @@ -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; } |