All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sim: Don't submit parallel EFpl reads
@ 2017-12-08 14:57 Slava Monich
  2017-12-08 16:23 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Slava Monich @ 2017-12-08 14:57 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

In addition to not doing unnecessary SIM I/O, this fixes memory leaks
like this one:

==10096== 74 (56 direct, 18 indirect) bytes in 2 blocks are definitely lost in loss record 1,252 of 1,342
==10096==    at 0x4841BF0: calloc (vg_replace_malloc.c)
==10096==    by 0x4B03117: g_malloc0 (gmem.c)
==10096==    by 0xF83DF: concat_lang_prefs (sim.c)
==10096==    by 0xF8697: sim_efpl_read_cb (sim.c)
==10096==    by 0x12CBF7: sim_fs_op_read_block_cb (simfs.c)
---
 src/sim.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sim.c b/src/sim.c
index 2538c77..31df636 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -2200,6 +2200,9 @@ static void sim_efli_efpl_changed(int id, void *userdata)
 	if (sim->efli != NULL) /* This shouldn't happen */
 		return;
 
+	if (sim->language_prefs_update)
+		return;
+
 	if (sim->language_prefs) {
 		g_strfreev(sim->language_prefs);
 		sim->language_prefs = NULL;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sim: Don't submit parallel EFpl reads
  2017-12-08 14:57 [PATCH] sim: Don't submit parallel EFpl reads Slava Monich
@ 2017-12-08 16:23 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2017-12-08 16:23 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Hi Slava,

On 12/08/2017 08:57 AM, Slava Monich wrote:
> In addition to not doing unnecessary SIM I/O, this fixes memory leaks
> like this one:
> 
> ==10096== 74 (56 direct, 18 indirect) bytes in 2 blocks are definitely lost in loss record 1,252 of 1,342
> ==10096==    at 0x4841BF0: calloc (vg_replace_malloc.c)
> ==10096==    by 0x4B03117: g_malloc0 (gmem.c)
> ==10096==    by 0xF83DF: concat_lang_prefs (sim.c)
> ==10096==    by 0xF8697: sim_efpl_read_cb (sim.c)
> ==10096==    by 0x12CBF7: sim_fs_op_read_block_cb (simfs.c)
> ---
>   src/sim.c | 3 +++
>   1 file changed, 3 insertions(+)
> 

Applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-08 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 14:57 [PATCH] sim: Don't submit parallel EFpl reads Slava Monich
2017-12-08 16:23 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.