This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/3] do_serial_close, remove early return.
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 08 Jun 2012 23:58:05 +0100
- Subject: [PATCH 1/3] do_serial_close, remove early return.
- References: <20120608225758.9866.76207.stgit@brno.lan>
Indeed, such guards are really bogus.
2012-06-08 Pedro Alves <palves@redhat.com>
* serial.c (do_serial_close): Remove early return when SCB is
null.
---
gdb/serial.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/gdb/serial.c b/gdb/serial.c
index 3eed3b9..9b689ba 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -330,12 +330,6 @@ do_serial_close (struct serial *scb, int really_close)
serial_logfp = NULL;
}
-/* This is bogus. It's not our fault if you pass us a bad scb...! Rob, you
- should fix your code instead. */
-
- if (!scb)
- return;
-
scb->refcnt--;
if (scb->refcnt > 0)
return;