summaryrefslogtreecommitdiff
blob: a32f207f328c1709d83692edb14f7feee9de8ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Index: epson2.c
===================================================================
RCS file: /cvsroot/sane/sane-backends/backend/epson2.c,v
retrieving revision 1.15
retrieving revision 1.17
diff -u -r1.15 -r1.17
--- backend/epson2.c	3 Feb 2008 12:09:09 -0000	1.15
+++ backend/epson2.c	3 May 2008 14:43:07 -0000	1.17
@@ -1243,6 +1243,7 @@
 	 *  set dummy values.
 	 */
 
+	s->fd = -1;
 	s->hw = dev;
 
 	dev->name = NULL;
@@ -1323,7 +1324,6 @@
 		if (status != SANE_STATUS_GOOD) {
 			DBG(1, "%s: inquiry failed: %s\n", __func__,
 			    sane_strstatus(status));
-			close_scanner(s);
 			goto free;
 		}
 
@@ -1534,8 +1534,6 @@
 		dev->need_reset_on_source_change = SANE_TRUE;
 	}
 
-	close_scanner(s);
-
 	/* we are done with this one, prepare for the next scanner */
 	num_devices++;
 	dev->next = first_dev;
@@ -1545,6 +1543,7 @@
 		*devp = dev;
 
       free:
+      	close_scanner(s);
 	free(s);
 	return status;
 }