All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giacinto Cifelli <gciofono@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v4 1/2] Gemalto: voicecall atom
Date: Wed, 17 Oct 2018 10:01:44 +0200	[thread overview]
Message-ID: <CAKSBH7E+0XikiXST7czB+JWk+BtQaS2TWV8+xs6qbhwCSpj4QA@mail.gmail.com> (raw)
In-Reply-To: <cae21e96-7824-6e1c-7bb8-0d73b5139528@southpole.se>

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

Hi again,

On Wed, Oct 17, 2018 at 8:28 AM Jonas Bonn <jonas@southpole.se> wrote:
>
> Hi,
>
>
> On 17/10/18 06:52, Giacinto Cifelli wrote:
> > Added voicecall atom specific for Gemalto modems.

> > diff --git a/drivers/gemaltomodem/voicecall.c b/drivers/gemaltomodem/voicecall.c
> > new file mode 100644
> > index 00000000..8e2c7e10
> > --- /dev/null
> > +++ b/drivers/gemaltomodem/voicecall.c
> > @@ -0,0 +1,581 @@

> > +static void gemalto_send_dtmf(struct ofono_voicecall *vc, const char *dtmf,
> > +                     ofono_voicecall_cb_t cb, void *data)
> > +{
> > +     int len = strlen(dtmf);
> > +     int s;
> > +     int i;
> > +     char *buf;
> > +     struct ofono_modem *modem = ofono_voicecall_get_modem(vc);
> > +     int use_quotes = ofono_modem_get_integer(modem, "GemaltoVtsQuotes");
> > +
> > +     /* strlen("+VTS=\"T\";") = 9 + initial AT + null */
> > +     buf = g_new(char, len * 9 + 3);
>
> Use alloca() instead... currently you are leaking buf.

Gladly, excellent idea.
Stack allocation is very sparingly used in ofono, while it would be a
better alternative in many cases.

Regards,
Giacinto

  parent reply	other threads:[~2018-10-17  8:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17  4:52 [PATCH v4 0/2] Gemalto: support for voicecall Giacinto Cifelli
2018-10-17  4:52 ` [PATCH v4 1/2] Gemalto: voicecall atom Giacinto Cifelli
2018-10-17  6:28   ` Jonas Bonn
2018-10-17  7:30     ` Giacinto Cifelli
2018-10-17  8:33       ` Jonas Bonn
2018-10-17  8:52         ` Giacinto Cifelli
2018-10-17 10:29           ` Jonas Bonn
2018-10-17  8:01     ` Giacinto Cifelli [this message]
2018-10-17 15:18     ` Denis Kenzior
2018-10-17 16:30       ` Jonas Bonn
2018-10-17 16:34         ` Denis Kenzior
2018-10-17 16:37           ` Giacinto Cifelli
2018-10-17  4:52 ` [PATCH v4 2/2] plugins/gemalto: added voice support Giacinto Cifelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKSBH7E+0XikiXST7czB+JWk+BtQaS2TWV8+xs6qbhwCSpj4QA@mail.gmail.com \
    --to=gciofono@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.