SCM

[#315491] [Patch] Device not set to unitialized on sane_close

View Trackers | Bugs | Export CSV

Date:
2016-09-09 21:13
Priority:
3
State:
Closed
Submitted by:
Sandro Mani (smani-guest)
Assigned to:
Olaf Meeuwissen (olaf-guest)
Category:
backends (drivers)
Group:
None
Resolution:
Fixed
Summary:
[Patch] Device not set to unitialized on sane_close

Detailed description
sane_close in genesys.c does not set dev->already_initialized to false. This causes a crash when using the scanner a second time in the same session, since i.e. the gamma tables are deallocated on sane_close, but are not re-allocated on sane_open since dev->already_initialized is still true after sane_close (and the gamma table and other stuff is only initialized if dev->already_initialized=false).

Trivial patch attached.

There are various downstream reports of this bug, i.e.:
https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1557812
https://bugs.launchpad.net/ubuntu/+source/simple-scan/+bug/1441457
https://bugzilla.redhat.com/show_bug.cgi?id=1191663
etc

Followups: Sort comments antichronologically

Message
Date: 2017-04-04 12:30
Sender: Olaf Meeuwissen

The person assigned to this tracker item is no longer a member of the project.
Date: 2017-04-08 12:10
Sender: Olaf Meeuwissen

Thanks. I just pushed a fix in 5edb87f9ac950473f8c3a57b4071c970887d8440.

I put the statement a little closer to the code that frees the gamma tables for "clarity".

Attached Files:

Attachments:
Size Name Date By Download
458 bytessane_already-initialized.patch2016-09-09 21:14smani-guestsane_already-initialized.patch

Changes:

Field Old Value Date By
status_idOpen2017-04-08 12:10olaf-guest
close_dateNone2017-04-08 12:10olaf-guest
assigned_tonone2017-04-08 12:10olaf-guest
ResolutionNone2017-04-08 12:10olaf-guest
assigned_tostefdev-guest2017-04-04 12:30olaf-guest
assigned_tonone2016-09-25 13:29kitno-guest
File Added7191: sane_already-initialized.patch2016-09-09 21:14smani-guest
Powered By FusionForge