Re: [PATCH 3/3] [media] exynos4-is: Fix potential NULL pointer dereference

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

 



Hi Sachin,

On 08/02/2013 08:32 AM, Sachin Kamat wrote:
> dev->of_node could be NULL. Hence check for the same and return before
> dereferencing it in the subsequent error message.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>
> ---
>  drivers/media/platform/exynos4-is/fimc-lite.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
> index 08fbfed..214bde2 100644
> --- a/drivers/media/platform/exynos4-is/fimc-lite.c
> +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
> @@ -1513,6 +1513,9 @@ static int fimc_lite_probe(struct platform_device *pdev)
>  		if (of_id)
>  			drv_data = (struct flite_drvdata *)of_id->data;
>  		fimc->index = of_alias_get_id(dev->of_node, "fimc-lite");
> +	} else {
> +		dev_err(dev, "device node not found\n");
> +		return -EINVAL;
>  	}

Thanks for the patch. I would prefer to add a check at very beginning
of fimc_lite_probe() like:

	if (!dev->of_node)
		return -ENODEV;

Those devices are only used on DT platforms.

--
Regards,
Sylwester
--
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