aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Williams <njw@chromium.org>2011-11-03 16:21:45 -0400
committerDan Williams <dcbw@redhat.com>2011-11-04 11:57:22 -0500
commit128e9abcee26ed691317b33aaacb795609855dd7 (patch)
treefdc791a4c5808ef98c37e5f3d411bbbe322ffe23 /src
parenta027d27da8bb723b344fc2805ae9f3e2489dac00 (diff)
serial: reject new commands when the port is closed.
Otherwise, we can schedule a main loop call to mm_serial_port_queue_process() for an object that's about to disappear, leading to a crash. Change-Id: I433a76855c52536eb2b99a5ecf26ac71afe1f8bb
Diffstat (limited to 'src')
-rw-r--r--src/mm-serial-port.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c
index caf500d9..29f99ef3 100644
--- a/src/mm-serial-port.c
+++ b/src/mm-serial-port.c
@@ -1021,6 +1021,7 @@ internal_queue_command (MMSerialPort *self,
MMQueueData *info;
g_return_if_fail (MM_IS_SERIAL_PORT (self));
+ g_return_if_fail (priv->open_count > 0);
g_return_if_fail (command != NULL);
info = g_slice_new0 (MMQueueData);