Message ID | 1367880759-20307-1-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 05/07/2013 06:52 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Coverity CID #997265, Resource leak. > > Need to free gpe resources before we return. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpi/lid/lid.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/acpi/lid/lid.c b/src/acpi/lid/lid.c > index c8827af..9117fc8 100644 > --- a/src/acpi/lid/lid.c > +++ b/src/acpi/lid/lid.c > @@ -114,6 +114,7 @@ static int lid_test_state(fwts_framework *fw, int button) > > if ((fd = fwts_acpi_event_open()) < 0) { > fwts_log_error(fw, "Cannot connect to acpid."); > + fwts_gpe_free(gpes_start, gpe_count); > return FWTS_ERROR; > } > > @@ -132,6 +133,8 @@ static int lid_test_state(fwts_framework *fw, int button) > > if ((gpe_count = fwts_gpe_read(&gpes_end)) == FWTS_ERROR) { > fwts_log_error(fw, "Cannot read GPEs."); > + fwts_gpe_free(gpes_start, gpe_count); > + return FWTS_ERROR; > } > > fwts_gpe_test(fw, gpes_start, gpes_end, gpe_count); > Acked-by: Alex Hung <alex.hung@canonical.com>
On 05/07/2013 06:52 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Coverity CID #997265, Resource leak. > > Need to free gpe resources before we return. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpi/lid/lid.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/acpi/lid/lid.c b/src/acpi/lid/lid.c > index c8827af..9117fc8 100644 > --- a/src/acpi/lid/lid.c > +++ b/src/acpi/lid/lid.c > @@ -114,6 +114,7 @@ static int lid_test_state(fwts_framework *fw, int button) > > if ((fd = fwts_acpi_event_open()) < 0) { > fwts_log_error(fw, "Cannot connect to acpid."); > + fwts_gpe_free(gpes_start, gpe_count); > return FWTS_ERROR; > } > > @@ -132,6 +133,8 @@ static int lid_test_state(fwts_framework *fw, int button) > > if ((gpe_count = fwts_gpe_read(&gpes_end)) == FWTS_ERROR) { > fwts_log_error(fw, "Cannot read GPEs."); > + fwts_gpe_free(gpes_start, gpe_count); > + return FWTS_ERROR; > } > > fwts_gpe_test(fw, gpes_start, gpes_end, gpe_count); > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/acpi/lid/lid.c b/src/acpi/lid/lid.c index c8827af..9117fc8 100644 --- a/src/acpi/lid/lid.c +++ b/src/acpi/lid/lid.c @@ -114,6 +114,7 @@ static int lid_test_state(fwts_framework *fw, int button) if ((fd = fwts_acpi_event_open()) < 0) { fwts_log_error(fw, "Cannot connect to acpid."); + fwts_gpe_free(gpes_start, gpe_count); return FWTS_ERROR; } @@ -132,6 +133,8 @@ static int lid_test_state(fwts_framework *fw, int button) if ((gpe_count = fwts_gpe_read(&gpes_end)) == FWTS_ERROR) { fwts_log_error(fw, "Cannot read GPEs."); + fwts_gpe_free(gpes_start, gpe_count); + return FWTS_ERROR; } fwts_gpe_test(fw, gpes_start, gpes_end, gpe_count);