By cleaning up the driver state all devices will become inaccessible, which
means that is neither possible to query any information from it (like sample
rate) and it is also not possible to restart data acquisition.

sr_session_save() tries to query the sample rate from the device, as a result
calling sr_session_save() after calling sr_session_stop() - which is for example
done by sigrok-cli - will cause a segfault. This patch resolves the issue.

Signed-off-by: Lars-Peter Clausen <[email protected]>
---
 libsigrok/session.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/libsigrok/session.c b/libsigrok/session.c
index 9ffdfd4..4ad2dff 100644
--- a/libsigrok/session.c
+++ b/libsigrok/session.c
@@ -373,8 +373,6 @@ SR_API int sr_session_stop(void)
                if (dev->driver) {
                        if (dev->driver->dev_acquisition_stop)
                                
dev->driver->dev_acquisition_stop(dev->driver_index, dev);
-                       if (dev->driver->cleanup)
-                               dev->driver->cleanup();
                }
        }
 
-- 
1.7.10


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to