Re: [git:media_tree/master] [media] lirc_dev: avoid potential null-dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 3, 2015 at 9:33 PM, Mauro Carvalho Chehab
<mchehab@xxxxxxxxxxxxxxx> wrote:
> This is an automatic generated email to let you know that the following patch were queued at the
> http://git.linuxtv.org/cgit.cgi/media_tree.git tree:
>
> Subject: [media] lirc_dev: avoid potential null-dereference
> Author:  Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Date:    Tue Jan 6 22:53:37 2015 -0300
>
> We have to check pointer for NULL and then dereference it.

Sorry, seems I forgot to write that it is non-needed fix.
Regarding to the current poll_wait() implementation and that fact that
wait_poll is a first member of the struct lirc_buffer there is no
dereference.

>
> Signed-off-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx>
>
>  drivers/media/rc/lirc_dev.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> ---
>
> http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=3656cddd50018d562d2df87c4698783898732914
>
> diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
> index 1e0545a..4de0e85 100644
> --- a/drivers/media/rc/lirc_dev.c
> +++ b/drivers/media/rc/lirc_dev.c
> @@ -553,14 +553,14 @@ unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
>         if (!ir->attached)
>                 return POLLERR;
>
> -       poll_wait(file, &ir->buf->wait_poll, wait);
> +       if (ir->buf) {
> +               poll_wait(file, &ir->buf->wait_poll, wait);
>
> -       if (ir->buf)
>                 if (lirc_buffer_empty(ir->buf))
>                         ret = 0;
>                 else
>                         ret = POLLIN | POLLRDNORM;
> -       else
> +       } else
>                 ret = POLLERR;
>
>         dev_dbg(ir->d.dev, LOGHEAD "poll result = %d\n",



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux