Message ID | 20201007092239.41704-4-tomi.valkeinen@iki.fi |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Tomi, On 07/10/2020 10:22, Tomi Valkeinen wrote: > ~IPAVimc() checks if fd != 0, but it should check if fd != -1. > Aha, - that explains a valgrind error I saw but hadn't yet investigated ;-) Thanks Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi> > --- > src/ipa/vimc/vimc.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp > index ef25776..372a15f 100644 > --- a/src/ipa/vimc/vimc.cpp > +++ b/src/ipa/vimc/vimc.cpp > @@ -61,7 +61,7 @@ IPAVimc::IPAVimc() > > IPAVimc::~IPAVimc() > { > - if (fd_) > + if (fd_ != -1) > ::close(fd_); > } > >
Hi Tomi, Thank you for the patch. On Wed, Oct 07, 2020 at 12:22:39PM +0300, Tomi Valkeinen wrote: > ~IPAVimc() checks if fd != 0, but it should check if fd != -1. > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi> We should use the FileDeescriptor class to handle file descriptors. But this code will be reworked anyway, so for now, Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/ipa/vimc/vimc.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp > index ef25776..372a15f 100644 > --- a/src/ipa/vimc/vimc.cpp > +++ b/src/ipa/vimc/vimc.cpp > @@ -61,7 +61,7 @@ IPAVimc::IPAVimc() > > IPAVimc::~IPAVimc() > { > - if (fd_) > + if (fd_ != -1) > ::close(fd_); > } >
diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp index ef25776..372a15f 100644 --- a/src/ipa/vimc/vimc.cpp +++ b/src/ipa/vimc/vimc.cpp @@ -61,7 +61,7 @@ IPAVimc::IPAVimc() IPAVimc::~IPAVimc() { - if (fd_) + if (fd_ != -1) ::close(fd_); }
~IPAVimc() checks if fd != 0, but it should check if fd != -1. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi> --- src/ipa/vimc/vimc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)