[PATCH 5/5] video: imx-ipu-v3: fix possible NULL ptr dereference

Fabio Estevam festevam at gmail.com
Mon Apr 21 13:43:46 PDT 2014


On Mon, Apr 21, 2014 at 5:15 PM, Lucas Stach <dev at lynxeye.de> wrote:
> Signed-off-by: Lucas Stach <dev at lynxeye.de>
> ---
>  drivers/video/imx-ipu-v3/ipu-dmfc.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/imx-ipu-v3/ipu-dmfc.c b/drivers/video/imx-ipu-v3/ipu-dmfc.c
> index 7b54e25001c6..61704f4a9c06 100644
> --- a/drivers/video/imx-ipu-v3/ipu-dmfc.c
> +++ b/drivers/video/imx-ipu-v3/ipu-dmfc.c
> @@ -146,16 +146,18 @@ EXPORT_SYMBOL_GPL(ipu_dmfc_disable_channel);
>  static int ipu_dmfc_setup_channel(struct dmfc_channel *dmfc, int slots,
>                 int segment, int burstsize)
>  {
> -       struct ipu_dmfc_priv *priv = dmfc->priv;
> +       struct ipu_dmfc_priv *priv;
>         u32 val, field;
>
> +       if (!dmfc)
> +               return -EINVAL;

Would be better to fix it in the same way we did in the kernel:
http://www.spinics.net/lists/linux-driver-devel/msg45096.html



More information about the barebox mailing list