[libcamera-devel,1/4] libcamera: pipeline: vimc: Initialize device pointers

Message ID 20190805155133.11335-2-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • libcamera: Fix issues with vimc and Linux v5.2
Related show

Commit Message

Niklas Söderlund Aug. 5, 2019, 3:51 p.m. UTC
As the device pointers are deleted in the pipelines destructor it's not
a good idea to have them uninitialized.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/libcamera/pipeline/vimc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart Aug. 5, 2019, 5:31 p.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Mon, Aug 05, 2019 at 05:51:30PM +0200, Niklas Söderlund wrote:
> As the device pointers are deleted in the pipelines destructor it's not
> a good idea to have them uninitialized.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/libcamera/pipeline/vimc.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
> index 61b68a32ea508af8..3d6808222a8a2c5d 100644
> --- a/src/libcamera/pipeline/vimc.cpp
> +++ b/src/libcamera/pipeline/vimc.cpp
> @@ -35,7 +35,7 @@ class VimcCameraData : public CameraData
>  {
>  public:
>  	VimcCameraData(PipelineHandler *pipe)
> -		: CameraData(pipe)
> +		: CameraData(pipe), video_(nullptr), sensor_(nullptr)
>  	{
>  	}
>

Patch

diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
index 61b68a32ea508af8..3d6808222a8a2c5d 100644
--- a/src/libcamera/pipeline/vimc.cpp
+++ b/src/libcamera/pipeline/vimc.cpp
@@ -35,7 +35,7 @@  class VimcCameraData : public CameraData
 {
 public:
 	VimcCameraData(PipelineHandler *pipe)
-		: CameraData(pipe)
+		: CameraData(pipe), video_(nullptr), sensor_(nullptr)
 	{
 	}