From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCH 2/3] Add Palm Pre plugin
Date: Tue, 10 Nov 2009 09:15:45 +0100 [thread overview]
Message-ID: <1257840945.3024.13.camel@violet> (raw)
In-Reply-To: <1257834623-22438-1-git-send-email-andrew.zaborowski@intel.com>
[-- Attachment #1: Type: text/plain, Size: 412 bytes --]
Hi Andrzej,
> +static void palmpre_remove(struct ofono_modem *modem)
> +{
> + struct palmpre_data *data = ofono_modem_get_data(modem);
> +
> + DBG("%p", modem);
> +
> + g_free(data);
> + ofono_modem_set_data(modem, NULL);
> +}
Never ever do it this way. The set_data(..., NULL) must come before
freeing the data. Otherwise it potentially opens a can of race
conditions.
Regards
Marcel
next prev parent reply other threads:[~2009-11-10 8:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 6:30 [PATCH 2/3] Add Palm Pre plugin Andrzej Zaborowski
2009-11-10 8:15 ` Marcel Holtmann [this message]
2009-11-10 22:27 ` Denis Kenzior
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=1257840945.3024.13.camel@violet \
--to=marcel@holtmann.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox