lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+V-a8sWa9zRamy4MLds5rkDVzeX5754kShhmC-cogeKiSwFEQ@mail.gmail.com>
Date:	Wed, 13 Jan 2016 10:40:41 +0000
From:	"Lad, Prabhakar" <prabhakar.csengg@...il.com>
To:	Javier Martinez Canillas <javier@....samsung.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Mauro Carvalho Chehab <mchehab@....samsung.com>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	linux-media <linux-media@...r.kernel.org>
Subject: Re: [PATCH v2 6/8] [media] tvp7002: Check v4l2_of_parse_endpoint()
 return value

On Mon, Jan 11, 2016 at 4:47 PM, Javier Martinez Canillas
<javier@....samsung.com> wrote:
> The v4l2_of_parse_endpoint() function can fail so check the return value.
>
> Signed-off-by: Javier Martinez Canillas <javier@....samsung.com>
> Acked-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
>
Acked-by: Lad, Prabhakar <prabhakar.csengg@...il.com>

Regards,
--Prabhakar Lad

> ---
>
> Changes in v2:
> - Assign pdata to NULL in case v4l2_of_parse_endpoint() fails before kzalloc.
>   Suggested by Sakari Ailus.
>
>  drivers/media/i2c/tvp7002.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
> index 83c79fa5f61d..4df640c3aa40 100644
> --- a/drivers/media/i2c/tvp7002.c
> +++ b/drivers/media/i2c/tvp7002.c
> @@ -894,7 +894,7 @@ static struct tvp7002_config *
>  tvp7002_get_pdata(struct i2c_client *client)
>  {
>         struct v4l2_of_endpoint bus_cfg;
> -       struct tvp7002_config *pdata;
> +       struct tvp7002_config *pdata = NULL;
>         struct device_node *endpoint;
>         unsigned int flags;
>
> @@ -905,11 +905,13 @@ tvp7002_get_pdata(struct i2c_client *client)
>         if (!endpoint)
>                 return NULL;
>
> +       if (v4l2_of_parse_endpoint(endpoint, &bus_cfg))
> +               goto done;
> +
>         pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
>         if (!pdata)
>                 goto done;
>
> -       v4l2_of_parse_endpoint(endpoint, &bus_cfg);
>         flags = bus_cfg.bus.parallel.flags;
>
>         if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
> --
> 2.4.3
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ