In qca_power_shutdown() qcadev local variable is
initialized by hu->serdev.dev private data, but
hu->serdev can be NULL and there is a check for it.
Since, qcadev is not used before
if (!hu->serdev)
return;
we can move its initialization after this "if" to
prevent gfp.
Signed-off-by: Pavel Skripkin <[email protected]>
---
drivers/bluetooth/hci_qca.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index de36af63e182..9589ef6c0c26 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1820,8 +1820,6 @@ static void qca_power_shutdown(struct hci_uart *hu)
unsigned long flags;
enum qca_btsoc_type soc_type = qca_soc_type(hu);
- qcadev = serdev_device_get_drvdata(hu->serdev);
-
/* From this point we go into power off state. But serial port is
* still open, stop queueing the IBS data and flush all the buffered
* data in skb's.
@@ -1837,6 +1835,8 @@ static void qca_power_shutdown(struct hci_uart *hu)
if (!hu->serdev)
return;
+ qcadev = serdev_device_get_drvdata(hu->serdev);
+
if (qca_is_wcn399x(soc_type)) {
host_set_baudrate(hu, 2400);
qca_send_power_pulse(hu, false);
--
2.31.1
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=476045
---Test result---
##############################
Test: CheckPatch - PASS
##############################
Test: CheckGitLint - FAIL
bluetooth: fix potential gfp
9: B3 Line contains hard tab characters (\t): " if (!hu->serdev)"
10: B3 Line contains hard tab characters (\t): " return;"
##############################
Test: CheckBuildK - PASS
##############################
Test: CheckTestRunner: Setup - PASS
##############################
Test: CheckTestRunner: l2cap-tester - PASS
Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
##############################
Test: CheckTestRunner: bnep-tester - PASS
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
##############################
Test: CheckTestRunner: mgmt-tester - PASS
Total: 416, Passed: 399 (95.9%), Failed: 0, Not Run: 17
##############################
Test: CheckTestRunner: rfcomm-tester - PASS
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0
##############################
Test: CheckTestRunner: sco-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
##############################
Test: CheckTestRunner: smp-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
##############################
Test: CheckTestRunner: userchan-tester - PASS
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0
---
Regards,
Linux Bluetooth
Hi Pavel,
> In qca_power_shutdown() qcadev local variable is
> initialized by hu->serdev.dev private data, but
> hu->serdev can be NULL and there is a check for it.
>
> Since, qcadev is not used before
>
> if (!hu->serdev)
> return;
>
> we can move its initialization after this "if" to
> prevent gfp.
>
> Signed-off-by: Pavel Skripkin <[email protected]>
> ---
> drivers/bluetooth/hci_qca.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
Hi Johan,
>>>>> In qca_power_shutdown() qcadev local variable is
>>>>> initialized by hu->serdev.dev private data, but
>>>>> hu->serdev can be NULL and there is a check for it.
>>>>>
>>>>> Since, qcadev is not used before
>>>>>
>>>>> if (!hu->serdev)
>>>>> return;
>>>>>
>>>>> we can move its initialization after this "if" to
>>>>> prevent gfp.
>>>>>
>>>>> Signed-off-by: Pavel Skripkin <[email protected]>
>>>>> ---
>>>>> drivers/bluetooth/hci_qca.c | 4 ++--
>>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> patch has been applied to bluetooth-next tree.
>>>
>>> Why did you pick the v1 when it is clear from thread that a v2 has been
>>> posted?
>>
>> because I only saw that email after I applied the patch and the v2 is
>> nowhere in sight as it seems. If it shows up, I replace this one then.
>
> Here it is
>
> https://lore.kernel.org/lkml/[email protected]/
seems to have missed my inbox. Fixed now.
Regards
Marcel