Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] media: lirc: Fix uninitialized variable in ir_lirc_transmit_ir()
@ 2018-01-10  9:36 Dan Carpenter
  2018-01-23 13:14 ` Sean Young
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-01-10  9:36 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sean Young
  Cc: David Härdeman, linux-media, kernel-janitors

The "txbuf" is uninitialized when we call ir_raw_encode_scancode() so
this failure path would lead to a crash.

Fixes: a74b2bff5945 ("media: lirc: do not pass ERR_PTR to kfree")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index fae42f120aa4..5efe9cd2309a 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -295,7 +295,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
 		ret = ir_raw_encode_scancode(scan.rc_proto, scan.scancode,
 					     raw, LIRCBUF_SIZE);
 		if (ret < 0)
-			goto out_kfree;
+			goto out_free_raw;
 
 		count = ret;
 
@@ -366,6 +366,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
 	return n;
 out_kfree:
 	kfree(txbuf);
+out_free_raw:
 	kfree(raw);
 out_unlock:
 	mutex_unlock(&dev->lock);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-23 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10  9:36 [PATCH] media: lirc: Fix uninitialized variable in ir_lirc_transmit_ir() Dan Carpenter
2018-01-23 13:14 ` Sean Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox