From: Dan Carpenter Date: Thu, 4 Sep 2014 11:10:05 +0000 (-0300) Subject: [media] staging: lirc: freeing ERR_PTRs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3232e04df7224f31a31cfe927096f3d03ba743ab;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index 96c76b33770b..5441f40cf5a1 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 81f90e17e1e6..c32e2965da87 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; }