OSDN Git Service

device: Fix returned error code
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Fri, 26 Apr 2013 06:16:57 +0000 (08:16 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 26 Apr 2013 07:11:15 +0000 (10:11 +0300)
The second 'err' shadows the main local variable which is being used to
as return value of the function. Otherwise -ENOENT was always returned
in case of error.

src/device.c

index 5f67610..18beed9 100644 (file)
@@ -1060,8 +1060,6 @@ static int connect_next(struct btd_device *dev)
        int err = -ENOENT;
 
        while (dev->pending) {
-               int err;
-
                profile = dev->pending->data;
 
                err = profile->connect(dev, profile);