Commit Graph

20 Commits

Author SHA1 Message Date
Jonas Bonn 67701b1c40 drivers: constify vtables
The driver vtables are read-only structures.  This patch declares them as
'const' allowing the compiler to (optionally) put them in the RELRO
section.  RELRO pages may be marked as read-only by the linker after
the relocations have been done ensuring that they aren't inadvertently
or maliciously altered at runtime.
2018-10-17 09:56:27 -05:00
Denis Kenzior 3d592d7d46 hfpmodem: Make sure to set the prefix properly
ofonod[1239]: > AT+COPS=3,0\r
ofonod[1239]: < \r\n+BCS:2\r\n
ofonod[1239]: < \r\nOK\r\n
2015-02-20 10:28:24 -06:00
Claudio Takahasi 0772fda92e hfpmodem: Fix segfault in CIEV GAtChat callback
This patch fixes segmentation fault when the network registration
watch is called without being initialized. CIEV GAtChat callback can
be called before ofono_netreg_register().

==15101== Invalid read of size 8
==15101==    at 0x492B56: ofono_netreg_register (network.c:2073)
==15101==    by 0x47245E: hfp_netreg_probe (network-registration.c:311)
==15101==    by 0x492A8D: ofono_netreg_create (network.c:1881)
==15101==    by 0x4849D5: hfp_pre_sim (hfp_hf_bluez5.c:288)
==15101==    by 0x48C486: ofono_modem_set_powered (modem.c:1194)
==15101==    by 0x484E9D: slc_established (hfp_hf_bluez5.c:85)
==15101==    by 0x4702AD: chld_cb (slc.c:147)
==15101==    by 0x440457: at_chat_finish_command (gatchat.c:461)
==15101==    by 0x44109F: new_bytes (gatchat.c:532)
==15101==    by 0x4433B7: received_data (gatio.c:122)
==15101==    by 0x3CBAA47824: g_main_context_dispatch (gmain.c:2539)
==15101==    by 0x3CBAA47B57: g_main_context_iterate.isra.23
(gmain.c:3146)
==15101==  Address 0x18 is not stack'd, malloc'd or (recently) free'd
2013-02-21 17:09:54 -06:00
Mikel Astiz c1ed32db9d hfpmodem: Avoid segfault in network-registration
The use of g_idle_add can cause a segmentation fault if the object is
destroyed in the meantime.
2011-10-21 13:17:13 -05:00
Marcel Holtmann 4e77afffb3 drivers: Update copyright information 2011-10-10 13:39:48 -07:00
Frédéric Dalleau f13b3d3a6b hfpmodem: Fix g_at_chat leak 2011-08-05 17:02:36 -05:00
Frédéric Danis c6c7fc3b16 hfpmodem: fix network status
When receiving roaming indicator update to 0 (no roaming) network
registration status should be updated with latest value of service
indicator.
2011-07-25 23:07:54 -05:00
Denis Kenzior b33d6b5fcb hfp_hf: Reorganize common code into hfpmodem 2011-07-21 03:49:27 -05:00
Jeevaka Badrappan ae9feb72e9 hfpmodem: fix memory leak 2011-01-29 12:43:17 -06:00
Jeevaka Badrappan 0f4b44d5cf hfpmodem: remove NULL check 2011-01-29 18:39:37 +01:00
Jeevaka Badrappan 7e52569104 hfpmodem: M15 coding style fix 2011-01-12 08:06:58 -08:00
Lucas De Marchi b82a7f8511 drivers: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)

// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@

- !E
+ E == NULL
// </smpl>
2010-11-29 11:37:09 -06:00
Marcel Holtmann 41133da001 hfpmodem: Remove useless NULL checks before g_free 2010-08-16 22:06:24 +02:00
Denis Kenzior 7f9a9b0cdc Fix: Don't use ofono_debug directly in plugins 2010-02-08 12:09:01 -06:00
Denis Kenzior c9b80a73c1 Fix: Don't send undefined values to the core 2010-02-04 00:26:20 -06:00
Marcel Holtmann 144080e749 Update copyright information 2010-01-01 17:00:10 -08:00
Denis Kenzior 39b043a40a Fix: Report status & tech in hfpmodem 2009-11-18 13:02:26 -06:00
Zhenhua Zhang 3003ebd066 Fix: Set data to NULL in hfpmodem drivers 2009-11-12 11:21:00 -06:00
Denis Kenzior c63a0413cd Fix: Minor style issues 2009-11-03 11:57:43 -06:00
Gustavo F. Padovan 1acd7f8b75 Create network registration driver for hfpmodem
This driver handles phone informations about registration status, signal
strength and roaming status listening +CIEV commands.  It also gets the
Network Operator name with +COPS commands.
2009-11-03 11:49:35 -06:00