summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/ipu3/imgu.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-08 03:40:25 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-09 11:26:13 +0200
commitff2ee0174ca62ab4460adfe20049ed05f52615c5 (patch)
tree292907ad2f2cc3252d9027822a7024dce6a59021 /src/libcamera/pipeline/ipu3/imgu.cpp
parent2795f333fce5f43a4239d8d40d34dde4e5caa6ca (diff)
libcamera: v4l2_subdevice: Return a unique pointer from fromEntityName()
The fromEntityName() function returns a pointer to a newly allocated V4L2Subdevice instance, which must be deleted by the caller. This opens the door to memory leaks. Return a unique pointer instead, which conveys the API semantics better than a sentence in the documentation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/pipeline/ipu3/imgu.cpp')
-rw-r--r--src/libcamera/pipeline/ipu3/imgu.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp
index a4d74a62..bfe9624c 100644
--- a/src/libcamera/pipeline/ipu3/imgu.cpp
+++ b/src/libcamera/pipeline/ipu3/imgu.cpp
@@ -343,7 +343,7 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index)
* by the match() function: no need to check for newly created
* video devices and subdevice validity here.
*/
- imgu_.reset(V4L2Subdevice::fromEntityName(media, name_));
+ imgu_ = V4L2Subdevice::fromEntityName(media, name_);
ret = imgu_->open();
if (ret)
return ret;