Last Comment Bug 712226 - Crash when fclose(NULL)'ing a battery-status FILE*
: Crash when fclose(NULL)'ing a battery-status FILE*
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Hardware Abstraction Layer (HAL) (show other bugs)
: Trunk
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla12
Assigned To: Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-19 23:46 PST by Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
Modified: 2011-12-22 03:47 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Don't try to fclose() NULL FILE*'s. (870 bytes, patch)
2011-12-19 23:48 PST, Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
mwu.code: review+
Details | Diff | Splinter Review

Description Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2011-12-19 23:46:35 PST
On the maguro device, we don't have the same /sys/class/power_supply/battery/charging_source file, so opening it fails.  Then we crash trying to close a null FILE*.  Simple fix, "real" fix to read the right file coming up later.
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2011-12-19 23:48:40 PST
Created attachment 583089 [details] [diff] [review]
Don't try to fclose() NULL FILE*'s.

I'm happy to land this after the uplift.  Would prefer to not lose more blame history.
Comment 3 Ed Morley [:emorley] 2011-12-22 03:47:03 PST
https://hg.mozilla.org/mozilla-central/rev/fa06927b6435

Note You need to log in before you can comment on or make changes to this bug.