All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
@ 2020-05-07 11:55 ` Wei Yongjun
  0 siblings, 0 replies; 12+ messages in thread
From: Wei Yongjun @ 2020-05-07 11:55 UTC (permalink / raw)
  To: Sanjay R Mehta, Mark Brown
  Cc: Wei Yongjun, linux-spi, kernel-janitors, Hulk Robot

The call to spi_master_put() in amd_spi_remove() is redundant and
may causes user after free since the master have been freed by
spi_unregister_master(), so remove it.

Fixes: bbb336f39efc ("spi: spi-amd: Add AMD SPI controller driver support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/spi/spi-amd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c
index c7cfc3dc20b1..e5e767ba5823 100644
--- a/drivers/spi/spi-amd.c
+++ b/drivers/spi/spi-amd.c
@@ -304,7 +304,6 @@ static int amd_spi_remove(struct platform_device *pdev)
 	struct amd_spi *amd_spi = platform_get_drvdata(pdev);
 
 	spi_unregister_master(amd_spi->master);
-	spi_master_put(amd_spi->master);
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;

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

* [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
@ 2020-05-07 11:55 ` Wei Yongjun
  0 siblings, 0 replies; 12+ messages in thread
From: Wei Yongjun @ 2020-05-07 11:55 UTC (permalink / raw)
  To: Sanjay R Mehta, Mark Brown
  Cc: Wei Yongjun, linux-spi, kernel-janitors, Hulk Robot

The call to spi_master_put() in amd_spi_remove() is redundant and
may causes user after free since the master have been freed by
spi_unregister_master(), so remove it.

Fixes: bbb336f39efc ("spi: spi-amd: Add AMD SPI controller driver support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/spi/spi-amd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c
index c7cfc3dc20b1..e5e767ba5823 100644
--- a/drivers/spi/spi-amd.c
+++ b/drivers/spi/spi-amd.c
@@ -304,7 +304,6 @@ static int amd_spi_remove(struct platform_device *pdev)
 	struct amd_spi *amd_spi = platform_get_drvdata(pdev);
 
 	spi_unregister_master(amd_spi->master);
-	spi_master_put(amd_spi->master);
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;




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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
  2020-05-07 11:55 ` Wei Yongjun
@ 2020-05-08 17:14   ` Mark Brown
  -1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-05-08 17:14 UTC (permalink / raw)
  To: Sanjay R Mehta, Wei Yongjun; +Cc: linux-spi, kernel-janitors, Hulk Robot

On Thu, 7 May 2020 11:55:50 +0000, Wei Yongjun wrote:
> The call to spi_master_put() in amd_spi_remove() is redundant and
> may causes user after free since the master have been freed by
> spi_unregister_master(), so remove it.

Applied to

   local tree regulator/for-5.7

Thanks!

[1/1] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
      (no commit info)

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
@ 2020-05-08 17:14   ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-05-08 17:14 UTC (permalink / raw)
  To: Sanjay R Mehta, Wei Yongjun; +Cc: linux-spi, kernel-janitors, Hulk Robot

On Thu, 7 May 2020 11:55:50 +0000, Wei Yongjun wrote:
> The call to spi_master_put() in amd_spi_remove() is redundant and
> may causes user after free since the master have been freed by
> spi_unregister_master(), so remove it.

Applied to

   local tree regulator/for-5.7

Thanks!

[1/1] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
      (no commit info)

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
  2020-05-07 11:55 ` Wei Yongjun
@ 2020-05-08 17:53   ` Mark Brown
  -1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-05-08 17:53 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Sanjay R Mehta, linux-spi, kernel-janitors, Hulk Robot

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

On Thu, May 07, 2020 at 11:55:50AM +0000, Wei Yongjun wrote:
> The call to spi_master_put() in amd_spi_remove() is redundant and
> may causes user after free since the master have been freed by
> spi_unregister_master(), so remove it.

This doesn't apply against current code, please check and resend (there
were quite a few issues that got fixed).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
@ 2020-05-08 17:53   ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-05-08 17:53 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Sanjay R Mehta, linux-spi, kernel-janitors, Hulk Robot

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

On Thu, May 07, 2020 at 11:55:50AM +0000, Wei Yongjun wrote:
> The call to spi_master_put() in amd_spi_remove() is redundant and
> may causes user after free since the master have been freed by
> spi_unregister_master(), so remove it.

This doesn't apply against current code, please check and resend (there
were quite a few issues that got fixed).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
  2020-05-07 11:55 ` Wei Yongjun
@ 2020-05-11 17:21   ` Mark Brown
  -1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-05-11 17:21 UTC (permalink / raw)
  To: Sanjay R Mehta, Wei Yongjun; +Cc: kernel-janitors, linux-spi, Hulk Robot

On Thu, 7 May 2020 11:55:50 +0000, Wei Yongjun wrote:
> The call to spi_master_put() in amd_spi_remove() is redundant and
> may causes user after free since the master have been freed by
> spi_unregister_master(), so remove it.

Applied to

   local tree spi/for-5.7

Thanks!

[1/1] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
      (no commit info)

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
@ 2020-05-11 17:21   ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-05-11 17:21 UTC (permalink / raw)
  To: Sanjay R Mehta, Wei Yongjun; +Cc: kernel-janitors, linux-spi, Hulk Robot

On Thu, 7 May 2020 11:55:50 +0000, Wei Yongjun wrote:
> The call to spi_master_put() in amd_spi_remove() is redundant and
> may causes user after free since the master have been freed by
> spi_unregister_master(), so remove it.

Applied to

   local tree spi/for-5.7

Thanks!

[1/1] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
      (no commit info)

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
  2020-05-11 17:21   ` Mark Brown
@ 2020-05-11 17:29     ` Mark Brown
  -1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-05-11 17:29 UTC (permalink / raw)
  To: Sanjay R Mehta, Wei Yongjun; +Cc: kernel-janitors, linux-spi, Hulk Robot

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

On Mon, May 11, 2020 at 06:22:01PM +0100, Mark Brown wrote:
> On Thu, 7 May 2020 11:55:50 +0000, Wei Yongjun wrote:
> > The call to spi_master_put() in amd_spi_remove() is redundant and
> > may causes user after free since the master have been freed by
> > spi_unregister_master(), so remove it.
> 
> Applied to
> 
>    local tree spi/for-5.7

No it wasn't, sorry for the noise here.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
@ 2020-05-11 17:29     ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2020-05-11 17:29 UTC (permalink / raw)
  To: Sanjay R Mehta, Wei Yongjun; +Cc: kernel-janitors, linux-spi, Hulk Robot

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

On Mon, May 11, 2020 at 06:22:01PM +0100, Mark Brown wrote:
> On Thu, 7 May 2020 11:55:50 +0000, Wei Yongjun wrote:
> > The call to spi_master_put() in amd_spi_remove() is redundant and
> > may causes user after free since the master have been freed by
> > spi_unregister_master(), so remove it.
> 
> Applied to
> 
>    local tree spi/for-5.7

No it wasn't, sorry for the noise here.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
  2020-05-11 17:29     ` Mark Brown
@ 2020-05-12  1:22       ` Wei Yongjun
  -1 siblings, 0 replies; 12+ messages in thread
From: Wei Yongjun @ 2020-05-12  1:22 UTC (permalink / raw)
  To: Mark Brown, Sanjay R Mehta; +Cc: kernel-janitors, linux-spi, Hulk Robot



On 2020/5/12 1:29, Mark Brown wrote:
> On Mon, May 11, 2020 at 06:22:01PM +0100, Mark Brown wrote:
>> On Thu, 7 May 2020 11:55:50 +0000, Wei Yongjun wrote:
>>> The call to spi_master_put() in amd_spi_remove() is redundant and
>>> may causes user after free since the master have been freed by
>>> spi_unregister_master(), so remove it.
>>
>> Applied to
>>
>>    local tree spi/for-5.7
> 
> No it wasn't, sorry for the noise here.
> 

I saw similar patch has been merged, so we do not need this patch any more.

7b9c94bd13cc ("spi: amd: Fix refcount underflow on remove")

Links:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id{9c94bd13cc9dc9c0c4932ebacf756ae612d52a

Regards,
Wei Yongjun

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

* Re: [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove()
@ 2020-05-12  1:22       ` Wei Yongjun
  0 siblings, 0 replies; 12+ messages in thread
From: Wei Yongjun @ 2020-05-12  1:22 UTC (permalink / raw)
  To: Mark Brown, Sanjay R Mehta; +Cc: kernel-janitors, linux-spi, Hulk Robot



On 2020/5/12 1:29, Mark Brown wrote:
> On Mon, May 11, 2020 at 06:22:01PM +0100, Mark Brown wrote:
>> On Thu, 7 May 2020 11:55:50 +0000, Wei Yongjun wrote:
>>> The call to spi_master_put() in amd_spi_remove() is redundant and
>>> may causes user after free since the master have been freed by
>>> spi_unregister_master(), so remove it.
>>
>> Applied to
>>
>>    local tree spi/for-5.7
> 
> No it wasn't, sorry for the noise here.
> 

I saw similar patch has been merged, so we do not need this patch any more.

7b9c94bd13cc ("spi: amd: Fix refcount underflow on remove")

Links:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=7b9c94bd13cc9dc9c0c4932ebacf756ae612d52a

Regards,
Wei Yongjun

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

end of thread, other threads:[~2020-05-12  1:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 11:55 [PATCH -next] spi: spi-amd: Remove spi_master_put in amd_spi_remove() Wei Yongjun
2020-05-07 11:55 ` Wei Yongjun
2020-05-08 17:14 ` Mark Brown
2020-05-08 17:14   ` Mark Brown
2020-05-08 17:53 ` Mark Brown
2020-05-08 17:53   ` Mark Brown
2020-05-11 17:21 ` Mark Brown
2020-05-11 17:21   ` Mark Brown
2020-05-11 17:29   ` Mark Brown
2020-05-11 17:29     ` Mark Brown
2020-05-12  1:22     ` Wei Yongjun
2020-05-12  1:22       ` Wei Yongjun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.