linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bluetooth: fix potential gfp
@ 2021-05-01 15:04 Pavel Skripkin
  2021-05-03  7:57 ` Johan Hovold
  2021-05-07  8:27 ` [PATCH] bluetooth: fix potential gfp Marcel Holtmann
  0 siblings, 2 replies; 12+ messages in thread
From: Pavel Skripkin @ 2021-05-01 15:04 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: luiz.dentz, linux-bluetooth, linux-kernel, Pavel Skripkin

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 <paskripkin@gmail.com>
---
 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


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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-01 15:04 [PATCH] bluetooth: fix potential gfp Pavel Skripkin
@ 2021-05-03  7:57 ` Johan Hovold
  2021-05-03  8:37   ` Pavel Skripkin
  2021-05-03 10:06   ` [PATCH v2] bluetooth: hci_qca: fix potential GPF Pavel Skripkin
  2021-05-07  8:27 ` [PATCH] bluetooth: fix potential gfp Marcel Holtmann
  1 sibling, 2 replies; 12+ messages in thread
From: Johan Hovold @ 2021-05-03  7:57 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel,
	Bjorn Andersson, Rocky Liao, Matthias Kaehlcke

On Sat, May 01, 2021 at 06:04:45PM +0300, Pavel Skripkin wrote:
> 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.

Good catch. The commit message needs to be improved however.

First, what's a "gfp"? Did you mean GPF?

Second, I'd expect you to try to point to the commit that introduced
this issue (e.g. using a Fixes tag) and CC the person responsible. This
appears to be commit 5559904ccc08 ("Bluetooth: hci_qca: Add QCA Rome
power off support to the qca_power_shutdown()") but you should verify
that.

Third, this looks like it could be triggered by user space so you should
CC stable too so that the fix is backported.

Fourth, your commit summary (Subject) is missing the driver component
(i.e. "hci_qca").

> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> ---
>  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);

Johan

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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-03  7:57 ` Johan Hovold
@ 2021-05-03  8:37   ` Pavel Skripkin
  2021-05-03 10:06   ` [PATCH v2] bluetooth: hci_qca: fix potential GPF Pavel Skripkin
  1 sibling, 0 replies; 12+ messages in thread
From: Pavel Skripkin @ 2021-05-03  8:37 UTC (permalink / raw)
  To: Johan Hovold
  Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel,
	Bjorn Andersson, Rocky Liao, Matthias Kaehlcke

Hi!

On Mon, 3 May 2021 09:57:12 +0200
Johan Hovold <johan@kernel.org> wrote:
> On Sat, May 01, 2021 at 06:04:45PM +0300, Pavel Skripkin wrote:
> > 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.
> 
> Good catch. The commit message needs to be improved however.
> 
> First, what's a "gfp"? Did you mean GPF?

Yes, it's typo :(

> 
> Second, I'd expect you to try to point to the commit that introduced
> this issue (e.g. using a Fixes tag) and CC the person responsible.
> This appears to be commit 5559904ccc08 ("Bluetooth: hci_qca: Add QCA
> Rome power off support to the qca_power_shutdown()") but you should
> verify that.
> 
> Third, this looks like it could be triggered by user space so you
> should CC stable too so that the fix is backported.
> 
> Fourth, your commit summary (Subject) is missing the driver component
> (i.e. "hci_qca").
>

Ok, I'll fix it all and send v2 soon.

Thanks for your feedback!

> > Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> > ---
> >  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);
> 
> Johan


With regards,
Pavel Skripkin

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

* [PATCH v2] bluetooth: hci_qca: fix potential GPF
  2021-05-03  7:57 ` Johan Hovold
  2021-05-03  8:37   ` Pavel Skripkin
@ 2021-05-03 10:06   ` Pavel Skripkin
  2021-05-03 11:22     ` Johan Hovold
  1 sibling, 1 reply; 12+ messages in thread
From: Pavel Skripkin @ 2021-05-03 10:06 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: linux-bluetooth, linux-kernel, Pavel Skripkin, stable, Rocky Liao

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 GPF.

Fixes: 5559904ccc08 ("Bluetooth: hci_qca: Add QCA Rome power off support to the qca_power_shutdown()")
Cc: stable@vger.kernel.org # v5.6+
Cc: Rocky Liao <rjliao@codeaurora.org>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 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


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

* Re: [PATCH v2] bluetooth: hci_qca: fix potential GPF
  2021-05-03 10:06   ` [PATCH v2] bluetooth: hci_qca: fix potential GPF Pavel Skripkin
@ 2021-05-03 11:22     ` Johan Hovold
  0 siblings, 0 replies; 12+ messages in thread
From: Johan Hovold @ 2021-05-03 11:22 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: marcel, johan.hedberg, linux-bluetooth, linux-kernel, stable, Rocky Liao

On Mon, May 03, 2021 at 01:06:05PM +0300, Pavel Skripkin wrote:
> 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 GPF.
> 
> Fixes: 5559904ccc08 ("Bluetooth: hci_qca: Add QCA Rome power off support to the qca_power_shutdown()")
> Cc: stable@vger.kernel.org # v5.6+
> Cc: Rocky Liao <rjliao@codeaurora.org>
> Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
> ---

Next time, put a changelog here so we know what changed since earlier
version(s).

Reviewed-by: Johan Hovold <johan@kernel.org>

>  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);

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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-01 15:04 [PATCH] bluetooth: fix potential gfp Pavel Skripkin
  2021-05-03  7:57 ` Johan Hovold
@ 2021-05-07  8:27 ` Marcel Holtmann
  2021-05-07 13:11   ` Johan Hovold
  1 sibling, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2021-05-07  8:27 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: Johan Hedberg, Luiz Augusto von Dentz,
	Bluetooth Kernel Mailing List, linux-kernel

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 <paskripkin@gmail.com>
> ---
> drivers/bluetooth/hci_qca.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-07  8:27 ` [PATCH] bluetooth: fix potential gfp Marcel Holtmann
@ 2021-05-07 13:11   ` Johan Hovold
  2021-05-07 15:20     ` Marcel Holtmann
  0 siblings, 1 reply; 12+ messages in thread
From: Johan Hovold @ 2021-05-07 13:11 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Pavel Skripkin, Johan Hedberg, Luiz Augusto von Dentz,
	Bluetooth Kernel Mailing List, linux-kernel

On Fri, May 07, 2021 at 10:27:39AM +0200, Marcel Holtmann wrote:
> 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 <paskripkin@gmail.com>
> > ---
> > 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?

Johan

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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-07 13:11   ` Johan Hovold
@ 2021-05-07 15:20     ` Marcel Holtmann
  2021-05-07 15:30       ` Johan Hovold
  0 siblings, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2021-05-07 15:20 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Pavel Skripkin, Johan Hedberg, Luiz Augusto von Dentz,
	Bluetooth Kernel Mailing List, linux-kernel

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 <paskripkin@gmail.com>
>>> ---
>>> 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.

Regards

Marcel


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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-07 15:20     ` Marcel Holtmann
@ 2021-05-07 15:30       ` Johan Hovold
  2021-05-07 16:07         ` Marcel Holtmann
  0 siblings, 1 reply; 12+ messages in thread
From: Johan Hovold @ 2021-05-07 15:30 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Pavel Skripkin, Johan Hedberg, Luiz Augusto von Dentz,
	Bluetooth Kernel Mailing List, linux-kernel

On Fri, May 07, 2021 at 05:20:11PM +0200, Marcel Holtmann wrote:
> 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 <paskripkin@gmail.com>
> >>> ---
> >>> 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/20210503100605.5223-1-paskripkin@gmail.com/

Johan

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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-07 15:30       ` Johan Hovold
@ 2021-05-07 16:07         ` Marcel Holtmann
  2021-05-07 16:16           ` Johan Hovold
  0 siblings, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2021-05-07 16:07 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Pavel Skripkin, Johan Hedberg, Luiz Augusto von Dentz,
	Bluetooth Kernel Mailing List, linux-kernel

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 <paskripkin@gmail.com>
>>>>> ---
>>>>> 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/20210503100605.5223-1-paskripkin@gmail.com/

seems to have missed my inbox. Fixed now.

Regards

Marcel


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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-07 16:07         ` Marcel Holtmann
@ 2021-05-07 16:16           ` Johan Hovold
  2021-05-07 19:22             ` Marcel Holtmann
  0 siblings, 1 reply; 12+ messages in thread
From: Johan Hovold @ 2021-05-07 16:16 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Pavel Skripkin, Johan Hedberg, Luiz Augusto von Dentz,
	Bluetooth Kernel Mailing List, linux-kernel

On Fri, May 07, 2021 at 06:07:50PM +0200, Marcel Holtmann wrote:
> 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 <paskripkin@gmail.com>
> >>>>> ---
> >>>>> 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/20210503100605.5223-1-paskripkin@gmail.com/
> 
> seems to have missed my inbox. Fixed now.

Would you mind adding my Reviewed-by tag from the reply to that patch as
well?

I don't know if you're using b4 yet but it can be used to fetch it all
from lore.

Johan

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

* Re: [PATCH] bluetooth: fix potential gfp
  2021-05-07 16:16           ` Johan Hovold
@ 2021-05-07 19:22             ` Marcel Holtmann
  0 siblings, 0 replies; 12+ messages in thread
From: Marcel Holtmann @ 2021-05-07 19:22 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Pavel Skripkin, Johan Hedberg, Luiz Augusto von Dentz,
	Bluetooth Kernel Mailing List, linux-kernel

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 <paskripkin@gmail.com>
>>>>>>> ---
>>>>>>> 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/20210503100605.5223-1-paskripkin@gmail.com/
>> 
>> seems to have missed my inbox. Fixed now.
> 
> Would you mind adding my Reviewed-by tag from the reply to that patch as
> well?

sure thing.

Regards

Marcel


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

end of thread, other threads:[~2021-05-07 19:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01 15:04 [PATCH] bluetooth: fix potential gfp Pavel Skripkin
2021-05-03  7:57 ` Johan Hovold
2021-05-03  8:37   ` Pavel Skripkin
2021-05-03 10:06   ` [PATCH v2] bluetooth: hci_qca: fix potential GPF Pavel Skripkin
2021-05-03 11:22     ` Johan Hovold
2021-05-07  8:27 ` [PATCH] bluetooth: fix potential gfp Marcel Holtmann
2021-05-07 13:11   ` Johan Hovold
2021-05-07 15:20     ` Marcel Holtmann
2021-05-07 15:30       ` Johan Hovold
2021-05-07 16:07         ` Marcel Holtmann
2021-05-07 16:16           ` Johan Hovold
2021-05-07 19:22             ` Marcel Holtmann

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).