2015-12-22 14:00:18

by Syam Sidhardhan

[permalink] [raw]
Subject: [PATCH 1/3] Bluetooth: bcm203x: Remove redundant error message

devm_kzalloc prints its own OOM message upon failure.

Signed-off-by: Syam Sidhardhan <[email protected]>
---
drivers/bluetooth/bcm203x.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
index 364f82b..5b0ef7b 100644
--- a/drivers/bluetooth/bcm203x.c
+++ b/drivers/bluetooth/bcm203x.c
@@ -178,10 +178,8 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
return -ENODEV;

data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL);
- if (!data) {
- BT_ERR("Can't allocate memory for data structure");
+ if (!data)
return -ENOMEM;
- }

data->udev = udev;
data->state = BCM203X_LOAD_MINIDRV;
--
1.7.9.5



2015-12-22 14:27:52

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 1/3] Bluetooth: bcm203x: Remove redundant error message

Hi Syam,

> devm_kzalloc prints its own OOM message upon failure.
>
> Signed-off-by: Syam Sidhardhan <[email protected]>
> ---
> drivers/bluetooth/bcm203x.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


2015-12-22 14:27:50

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 2/3] Bluetooth: bfusb: Remove redundant error message

Hi Syam,

> devm_kzalloc prints its own OOM message upon failure.
>
> Signed-off-by: Syam Sidhardhan <[email protected]>
> ---
> drivers/bluetooth/bfusb.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


2015-12-22 14:27:45

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 3/3] Bluetooth: bfusb: Fix the return error code

Hi Syam,

> -ENOMEM is the appropriate error code instead of -EIO.
>
> Signed-off-by: Syam Sidhardhan <[email protected]>
> ---
> drivers/bluetooth/bfusb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


2015-12-22 14:00:20

by Syam Sidhardhan

[permalink] [raw]
Subject: [PATCH 3/3] Bluetooth: bfusb: Fix the return error code

-ENOMEM is the appropriate error code instead of -EIO.

Signed-off-by: Syam Sidhardhan <[email protected]>
---
drivers/bluetooth/bfusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index c304102..3bf4ec6 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -637,7 +637,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
/* Initialize control structure and load firmware */
data = devm_kzalloc(&intf->dev, sizeof(struct bfusb_data), GFP_KERNEL);
if (!data)
- goto done;
+ return -ENOMEM;

data->udev = udev;
data->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress;
--
1.7.9.5


2015-12-22 14:00:19

by Syam Sidhardhan

[permalink] [raw]
Subject: [PATCH 2/3] Bluetooth: bfusb: Remove redundant error message

devm_kzalloc prints its own OOM message upon failure.

Signed-off-by: Syam Sidhardhan <[email protected]>
---
drivers/bluetooth/bfusb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 72d8bfa..c304102 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -636,10 +636,8 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i

/* Initialize control structure and load firmware */
data = devm_kzalloc(&intf->dev, sizeof(struct bfusb_data), GFP_KERNEL);
- if (!data) {
- BT_ERR("Can't allocate memory for control structure");
+ if (!data)
goto done;
- }

data->udev = udev;
data->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress;
--
1.7.9.5