All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] eepromer/24cXX: fix leaking file descriptor
@ 2012-04-24 10:24 Nikola Pajkovsky
       [not found] ` <d53426eaec2f3212842b5a44a0fbc2d1c97f44e3.1335263046.git.npajkovs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Nikola Pajkovsky @ 2012-04-24 10:24 UTC (permalink / raw)
  To: lm-sensors

Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
---
 eepromer/24cXX.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eepromer/24cXX.c b/eepromer/24cXX.c
index 00a21fd..ab86c33 100644
--- a/eepromer/24cXX.c
+++ b/eepromer/24cXX.c
@@ -79,9 +79,10 @@ int eeprom_open(char *dev_fqn, int addr, int type, struct eeprom* e)
 		return -1;
 
 	// get funcs list
-	if((r = ioctl(fd, I2C_FUNCS, &funcs) < 0))
+	if((r = ioctl(fd, I2C_FUNCS, &funcs) < 0)) {
+		close(fd);
 		return r;
-
+	}
 	
 	// check for req funcs
 	CHECK_I2C_FUNC( funcs, I2C_FUNC_SMBUS_READ_BYTE );
-- 
1.7.9.3


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-25  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24 10:24 [lm-sensors] [PATCH] eepromer/24cXX: fix leaking file descriptor Nikola Pajkovsky
     [not found] ` <d53426eaec2f3212842b5a44a0fbc2d1c97f44e3.1335263046.git.npajkovs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-25  6:41   ` Jean Delvare
     [not found]     ` <20120425084126.317079a9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-04-25  7:50       ` Nikola Pajkovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.