Linux-Bluetooth Archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: btintel: Fixe build regression
@ 2024-02-23 17:38 Luiz Augusto von Dentz
  2024-02-23 17:41 ` Luiz Augusto von Dentz
  2024-02-26 15:10 ` patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2024-02-23 17:38 UTC (permalink / raw
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes the following build regression:

drivers-bluetooth-btintel.c-btintel_read_version()-warn:
passing-zero-to-PTR_ERR

Fixes: 36618e0d5a6d ("Bluetooth: btintel: Fix null ptr deref in btintel_read_version")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 drivers/bluetooth/btintel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index a083c4b8621c..6ba7f5d1b837 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -435,13 +435,13 @@ int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver)
 	struct sk_buff *skb;
 
 	skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT);
-	if (IS_ERR_OR_NULL(skb)) {
+	if (IS_ERR(skb)) {
 		bt_dev_err(hdev, "Reading Intel version information failed (%ld)",
 			   PTR_ERR(skb));
 		return PTR_ERR(skb);
 	}
 
-	if (skb->len != sizeof(*ver)) {
+	if (!skb || skb->len != sizeof(*ver)) {
 		bt_dev_err(hdev, "Intel version event size mismatch");
 		kfree_skb(skb);
 		return -EILSEQ;
-- 
2.43.0


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

* Re: [PATCH v1] Bluetooth: btintel: Fixe build regression
  2024-02-23 17:38 [PATCH v1] Bluetooth: btintel: Fixe build regression Luiz Augusto von Dentz
@ 2024-02-23 17:41 ` Luiz Augusto von Dentz
  2024-02-26 15:10 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2024-02-23 17:41 UTC (permalink / raw
  To: linux-bluetooth; +Cc: Edward Adam Davis

Hi Edward,


On Fri, Feb 23, 2024 at 12:38 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This fixes the following build regression:
>
> drivers-bluetooth-btintel.c-btintel_read_version()-warn:
> passing-zero-to-PTR_ERR
>
> Fixes: 36618e0d5a6d ("Bluetooth: btintel: Fix null ptr deref in btintel_read_version")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>  drivers/bluetooth/btintel.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
> index a083c4b8621c..6ba7f5d1b837 100644
> --- a/drivers/bluetooth/btintel.c
> +++ b/drivers/bluetooth/btintel.c
> @@ -435,13 +435,13 @@ int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver)
>         struct sk_buff *skb;
>
>         skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT);
> -       if (IS_ERR_OR_NULL(skb)) {
> +       if (IS_ERR(skb)) {
>                 bt_dev_err(hdev, "Reading Intel version information failed (%ld)",
>                            PTR_ERR(skb));
>                 return PTR_ERR(skb);
>         }
>
> -       if (skb->len != sizeof(*ver)) {
> +       if (!skb || skb->len != sizeof(*ver)) {
>                 bt_dev_err(hdev, "Intel version event size mismatch");
>                 kfree_skb(skb);
>                 return -EILSEQ;
> --
> 2.43.0

Looks like your change 36618e0d5a6d ("Bluetooth: btintel: Fix null ptr
deref in btintel_read_version") caused this build regression thus Im
CCing you just to confirm that reverting it and checking alongside the
len shall resolve the initial problem you were trying to fix.

-- 
Luiz Augusto von Dentz

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

* Re: [PATCH v1] Bluetooth: btintel: Fixe build regression
  2024-02-23 17:38 [PATCH v1] Bluetooth: btintel: Fixe build regression Luiz Augusto von Dentz
  2024-02-23 17:41 ` Luiz Augusto von Dentz
@ 2024-02-26 15:10 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2024-02-26 15:10 UTC (permalink / raw
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

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

On Fri, 23 Feb 2024 12:38:18 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This fixes the following build regression:
> 
> drivers-bluetooth-btintel.c-btintel_read_version()-warn:
> passing-zero-to-PTR_ERR
> 
> [...]

Here is the summary with links:
  - [v1] Bluetooth: btintel: Fixe build regression
    https://git.kernel.org/bluetooth/bluetooth-next/c/cd41fa3056ab

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] 3+ messages in thread

end of thread, other threads:[~2024-02-26 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-23 17:38 [PATCH v1] Bluetooth: btintel: Fixe build regression Luiz Augusto von Dentz
2024-02-23 17:41 ` Luiz Augusto von Dentz
2024-02-26 15:10 ` 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 read-only IMAP folder(s) and NNTP newsgroup(s).