[PATCH 2/3] Add Palm Pre plugin

Marcel Holtmann marcel at holtmann.org
Tue Nov 10 00:15:45 PST 2009


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




More information about the ofono mailing list