linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()
@ 2022-12-05 13:53 Wang ShaoBo
  2022-12-05 14:30 ` bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wang ShaoBo @ 2022-12-05 13:53 UTC (permalink / raw)
  Cc: liwei391, marcel, luiz.dentz, johan.hedberg, linux-bluetooth,
	linux-kernel, bobo.shaobowang

skb allocated by __hci_cmd_sync would not be used whether in checking
for supported iBT hardware variants or after, we should free it in all
error branches, this patch makes the case read version failed or default
error case free skb before return.

Fixes: c86c7285bb08 ("Bluetooth: btintel: Fix the legacy bootloader returns tlv based version")
Fixes: 019a1caa7fd2 ("Bluetooth: btintel: Refactoring setup routine for bootloader devices")
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
---
 drivers/bluetooth/btintel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index a657e9a3e96a..f6b4b7a1be4c 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -2524,7 +2524,7 @@ static int btintel_setup_combined(struct hci_dev *hdev)
 		 */
 		err = btintel_read_version(hdev, &ver);
 		if (err)
-			return err;
+			break;
 
 		/* Apply the device specific HCI quirks
 		 *
@@ -2566,7 +2566,8 @@ static int btintel_setup_combined(struct hci_dev *hdev)
 	default:
 		bt_dev_err(hdev, "Unsupported Intel hw variant (%u)",
 			   INTEL_HW_VARIANT(ver_tlv.cnvi_bt));
-		return -EINVAL;
+		err = -EINVAL;
+		break;
 	}
 
 exit_error:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()
  2022-12-05 13:53 [PATCH] Bluetooth: btintel: Fix missing free skb in btintel_setup_combined() Wang ShaoBo
@ 2022-12-05 14:30 ` bluez.test.bot
  2022-12-05 22:00 ` [PATCH] " Tedd Ho-Jeong An
  2022-12-06 17:50 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2022-12-05 14:30 UTC (permalink / raw)
  To: linux-bluetooth, bobo.shaobowang

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=701819

---Test result---

Test Summary:
CheckPatch                    PASS      0.56 seconds
GitLint                       PASS      0.28 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      34.44 seconds
BuildKernel32                 PASS      31.16 seconds
TestRunnerSetup               PASS      429.86 seconds
TestRunner_l2cap-tester       PASS      16.41 seconds
TestRunner_iso-tester         PASS      16.21 seconds
TestRunner_bnep-tester        PASS      5.56 seconds
TestRunner_mgmt-tester        PASS      108.80 seconds
TestRunner_rfcomm-tester      PASS      9.59 seconds
TestRunner_sco-tester         PASS      8.97 seconds
TestRunner_ioctl-tester       PASS      10.19 seconds
TestRunner_mesh-tester        PASS      7.09 seconds
TestRunner_smp-tester         PASS      8.76 seconds
TestRunner_userchan-tester    PASS      5.83 seconds
IncrementalBuild              PASS      31.75 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()
  2022-12-05 13:53 [PATCH] Bluetooth: btintel: Fix missing free skb in btintel_setup_combined() Wang ShaoBo
  2022-12-05 14:30 ` bluez.test.bot
@ 2022-12-05 22:00 ` Tedd Ho-Jeong An
  2022-12-06 17:50 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Tedd Ho-Jeong An @ 2022-12-05 22:00 UTC (permalink / raw)
  To: Wang ShaoBo
  Cc: liwei391, marcel, luiz.dentz, johan.hedberg, linux-bluetooth,
	linux-kernel

Hi ShaoBo,

On Mon, 2022-12-05 at 21:53 +0800, Wang ShaoBo wrote:
> skb allocated by __hci_cmd_sync would not be used whether in checking
> for supported iBT hardware variants or after, we should free it in all
> error branches, this patch makes the case read version failed or default
> error case free skb before return.
> 
> Fixes: c86c7285bb08 ("Bluetooth: btintel: Fix the legacy bootloader returns tlv based version")
> Fixes: 019a1caa7fd2 ("Bluetooth: btintel: Refactoring setup routine for bootloader devices")
> Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>

Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>

> ---
>  drivers/bluetooth/btintel.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
> index a657e9a3e96a..f6b4b7a1be4c 100644
> --- a/drivers/bluetooth/btintel.c
> +++ b/drivers/bluetooth/btintel.c
> @@ -2524,7 +2524,7 @@ static int btintel_setup_combined(struct hci_dev *hdev)
>                  */
>                 err = btintel_read_version(hdev, &ver);
>                 if (err)
> -                       return err;
> +                       break;
>  
>                 /* Apply the device specific HCI quirks
>                  *
> @@ -2566,7 +2566,8 @@ static int btintel_setup_combined(struct hci_dev *hdev)
>         default:
>                 bt_dev_err(hdev, "Unsupported Intel hw variant (%u)",
>                            INTEL_HW_VARIANT(ver_tlv.cnvi_bt));
> -               return -EINVAL;
> +               err = -EINVAL;
> +               break;
>         }
>  
>  exit_error:

Regards,
Tedd Ho-Jeong An

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()
  2022-12-05 13:53 [PATCH] Bluetooth: btintel: Fix missing free skb in btintel_setup_combined() Wang ShaoBo
  2022-12-05 14:30 ` bluez.test.bot
  2022-12-05 22:00 ` [PATCH] " Tedd Ho-Jeong An
@ 2022-12-06 17:50 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2022-12-06 17:50 UTC (permalink / raw)
  To: Wang ShaoBo
  Cc: liwei391, marcel, luiz.dentz, johan.hedberg, linux-bluetooth,
	linux-kernel

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 5 Dec 2022 21:53:57 +0800 you wrote:
> skb allocated by __hci_cmd_sync would not be used whether in checking
> for supported iBT hardware variants or after, we should free it in all
> error branches, this patch makes the case read version failed or default
> error case free skb before return.
> 
> Fixes: c86c7285bb08 ("Bluetooth: btintel: Fix the legacy bootloader returns tlv based version")
> Fixes: 019a1caa7fd2 ("Bluetooth: btintel: Refactoring setup routine for bootloader devices")
> Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
> 
> [...]

Here is the summary with links:
  - Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()
    https://git.kernel.org/bluetooth/bluetooth-next/c/6ae5399836fa

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-06 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-05 13:53 [PATCH] Bluetooth: btintel: Fix missing free skb in btintel_setup_combined() Wang ShaoBo
2022-12-05 14:30 ` bluez.test.bot
2022-12-05 22:00 ` [PATCH] " Tedd Ho-Jeong An
2022-12-06 17:50 ` patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).