[PATCH] floppy: add missing put_device()

sunran001@208suo.com posted 1 patch 2 years, 6 months ago
arch/sparc/include/asm/floppy_64.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] floppy: add missing put_device()
Posted by sunran001@208suo.com 2 years, 6 months ago
The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference.

./arch/sparc/include/asm/floppy_64.h:562:1-22: WARNING: Function
"for_each_node_by_name" should have of_node_put() before break around
line 567.

Signed-off-by: Ran Sun <sunran001@208suo.com>
---
  arch/sparc/include/asm/floppy_64.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sparc/include/asm/floppy_64.h 
b/arch/sparc/include/asm/floppy_64.h
index 53e77c0974f9..619255e8c9ac 100644
--- a/arch/sparc/include/asm/floppy_64.h
+++ b/arch/sparc/include/asm/floppy_64.h
@@ -594,7 +594,7 @@ static unsigned long __init sun_floppy_init(void)
          if (state_prop && !strncmp(state_prop, "disabled", 8)) {
              put_device(&op->dev);
              return 0;
-        }
+        }

          FLOPPY_IRQ = op->archdata.irqs[0];
Re: [PATCH] floppy: add missing put_device()
Posted by Sam Ravnborg 2 years, 6 months ago
Hi Ran Sun,

On Tue, Jul 18, 2023 at 05:02:54PM +0800, sunran001@208suo.com wrote:
> The of_find_device_by_node() takes a reference to the underlying device
> structure, we should release that reference.
> 
> ./arch/sparc/include/asm/floppy_64.h:562:1-22: WARNING: Function
> "for_each_node_by_name" should have of_node_put() before break around
> line 567.
> 
> Signed-off-by: Ran Sun <sunran001@208suo.com>
> ---
>  arch/sparc/include/asm/floppy_64.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sparc/include/asm/floppy_64.h
> b/arch/sparc/include/asm/floppy_64.h
> index 53e77c0974f9..619255e8c9ac 100644
> --- a/arch/sparc/include/asm/floppy_64.h
> +++ b/arch/sparc/include/asm/floppy_64.h
> @@ -594,7 +594,7 @@ static unsigned long __init sun_floppy_init(void)
>          if (state_prop && !strncmp(state_prop, "disabled", 8)) {
>              put_device(&op->dev);
>              return 0;
> -        }
> +        }
> 
>          FLOPPY_IRQ = op->archdata.irqs[0];

The patch does not include any changes. Please redo.

	Sam