* re: Bluetooth: btbcm: Read the local name in setup stage
@ 2015-10-06 18:57 Dan Carpenter
2015-10-07 4:45 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-10-06 18:57 UTC (permalink / raw)
To: marcel; +Cc: linux-bluetooth
Hello Marcel Holtmann,
The patch 8af9da1ab784: "Bluetooth: btbcm: Read the local name in
setup stage" from Oct 5, 2015, leads to the following static checker
warning:
drivers/bluetooth/btbcm.c:533 btbcm_setup_apple()
error: 'skb' dereferencing possible ERR_PTR()
drivers/bluetooth/btbcm.c
522 /* Read Verbose Config Version Info */
523 skb = btbcm_read_verbose_config(hdev);
524 if (!IS_ERR(skb)) {
525 BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name,
526 skb->data[1], get_unaligned_le16(skb->data + 5));
527 kfree_skb(skb);
528 }
529
530 /* Read Local Name */
531 skb = btbcm_read_local_name(hdev);
532 if (IS_ERR(skb)) {
This test is reversed?
533 BT_INFO("%s: %s", hdev->name, (char *)(skb->data + 1));
534 kfree_skb(skb);
535 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Bluetooth: btbcm: Read the local name in setup stage
2015-10-06 18:57 Bluetooth: btbcm: Read the local name in setup stage Dan Carpenter
@ 2015-10-07 4:45 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2015-10-07 4:45 UTC (permalink / raw)
To: Dan Carpenter; +Cc: marcel, linux-bluetooth
Hi Dan,
On Tue, Oct 06, 2015, Dan Carpenter wrote:
> The patch 8af9da1ab784: "Bluetooth: btbcm: Read the local name in
> setup stage" from Oct 5, 2015, leads to the following static checker
> warning:
>
> drivers/bluetooth/btbcm.c:533 btbcm_setup_apple()
> error: 'skb' dereferencing possible ERR_PTR()
>
> drivers/bluetooth/btbcm.c
> 522 /* Read Verbose Config Version Info */
> 523 skb = btbcm_read_verbose_config(hdev);
> 524 if (!IS_ERR(skb)) {
> 525 BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name,
> 526 skb->data[1], get_unaligned_le16(skb->data + 5));
> 527 kfree_skb(skb);
> 528 }
> 529
> 530 /* Read Local Name */
> 531 skb = btbcm_read_local_name(hdev);
> 532 if (IS_ERR(skb)) {
>
> This test is reversed?
>
> 533 BT_INFO("%s: %s", hdev->name, (char *)(skb->data + 1));
> 534 kfree_skb(skb);
> 535 }
That's indeed a bug. Thanks for the report. I went ahead and fixed this
up myself since the commit was still on the top of the bluetooth-next
tree.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-07 4:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 18:57 Bluetooth: btbcm: Read the local name in setup stage Dan Carpenter
2015-10-07 4:45 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox