Skip to contentSkip to conversation

staging: lirc: freeing ERR_PTRs

PATCH New Dan Carpenter 1 participant 1 message Sep 4, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lirc: freeing ERR_PTRs

We call kfree(data_buf) in the error handling and that will oops if this is an error pointer.

drivers/staging/media/lirc/lirc_imon.c +1 -0
index 96c76b3..5441f40 100644
@@ -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;
 	}
 
drivers/staging/media/lirc/lirc_sasem.c +1 -0
index 81f90e1..c32e296 100644
@@ -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;
 	}