Re: [RFC v0 05/15] network: Add network .connect and .disconnect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Oct 25, 2012 at 12:42 PM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote:
> Hi Lizardo,
>
> On Wed, Oct 24, 2012, Anderson Lizardo wrote:
>> Hi Mikel,
>>
>> On Fri, Oct 19, 2012 at 11:39 AM, Mikel Astiz <mikel.astiz.oss@xxxxxxxxx> wrote:
>> > +static void connect_profile_cb(struct btd_device *device, int err,
>> > +                                               const char *pdev, void *data)
>> > +{
>> > +       struct connect_req *req = data;
>> > +
>> > +       req->cb(req->profile, req->device, err);
>> > +
>> > +       g_free(req);
>> > +}
>> > +
>> > +static int connect_profile(struct btd_device *dev, struct btd_profile *profile,
>> > +                                               uint16_t id, btd_profile_cb cb)
>> > +{
>> > +       struct connect_req *req;
>> > +       int err;
>> > +
>> > +       DBG("path %s id %u", device_get_path(dev), id);
>> > +
>> > +       req  = g_new0(struct connect_req, 1);
>> > +       req->device = dev;
>>
>> Isn't btd_device_ref() required here?
>
> Looks like you're right and I missed this in my initial review. I went
> ahead and pushed an extra patch to fix this.

I don't think this patch was needed. Actually, the device pointer in
struct connect_req can be completely removed, since the callback
already receives such pointer, and the network_peer takes care of the
device refcounting. Mea culpa for adding this unnecessary field.

Cheers,
Mikel
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux