From: Sean Young <sean@mess.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
"David Härdeman" <david@hardeman.nu>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] media: lirc: Fix uninitialized variable in ir_lirc_transmit_ir()
Date: Tue, 23 Jan 2018 13:14:25 +0000 [thread overview]
Message-ID: <20180123131425.sghf77ivdd6weqsf@gofer.mess.org> (raw)
In-Reply-To: <20180110093623.z5kqrsnu72stchu5@mwanda>
On Wed, Jan 10, 2018 at 12:36:23PM +0300, Dan Carpenter wrote:
> The "txbuf" is uninitialized when we call ir_raw_encode_scancode() so
> this failure path would lead to a crash.
Thanks for reporting this issue, however I'm afraid that the issue has
already been resolved:
https://www.mail-archive.com/linux-media@vger.kernel.org/msg123672.html
and:
https://git.linuxtv.org/media_tree.git/commit/?id=8d25e15d94a2d7b60c28d3a30e4e0e780cab2056
Many thanks,
Sean
>
> 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);
prev parent reply other threads:[~2018-01-23 13:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180123131425.sghf77ivdd6weqsf@gofer.mess.org \
--to=sean@mess.org \
--cc=dan.carpenter@oracle.com \
--cc=david@hardeman.nu \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox