ata: pata_macio: add of_node_put()
PATCH 1/1 ata: pata_macio: add of_node_put()
of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. bl_idle_init() doesn't do that, so fix it.
--- drivers/ata/pata_macio.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/ata/pata_macio.c +2 -0
@@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)struct device_node *root =of_find_node_by_path ("/" );const char *model =of_get_property (root,"model" ,NULL ); +of_node_put (root); +if (cable && !strncmp (cable,"80-" ,3 )) {/* Some drives fail to detect 80c cable in PowerBook * These machine use proprietary short IDE cable
Signature · 1 line
2.17.0
Hello!
Quoted 3 lines · Yangtao Li
of_find_node_by_path()acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init()doesn't do that, so fix it.
I thought we're inside pata_macio_cable_detect()?
Quoted 10 lines
Signed-off-by Yangtao Li <[email protected]>--- drivers/ata/pata_macio.c | 2 ++ 1 file changed, 2 insertions(+)drivers/ata/pata_macio.c +0
-0
drivers/ata/pata_macio.c static int pata_macio_cable_detect(struct ata_port *ap) · line 490
Quoted 8 lines
drivers/ata/pata_macio.c +2
-0@@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)struct device_node *root =of_find_node_by_path ("/" );const char *model =of_get_property (root,"model" ,NULL ); +of_node_put (root); +if (cable && !strncmp (cable,"80-" ,3 )) {/* Some drives fail to detect 80c cable in PowerBook * These machine use proprietary short IDE cable
MBR, Sergei
Quoted 10 lines · Sergei Shtylyov
Hello!
Quoted 3 lines · Yangtao Li
of_find_node_by_path()acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init()doesn't do that, so fix it.I thought we're inside
pata_macio_cable_detect()?
Hi Sergei:
What do you mean?
Why not release the refcount of root?
Yours,
Yangtao
Quoted 21 lines
Quoted 11 lines
Signed-off-by Yangtao Li <[email protected]>--- drivers/ata/pata_macio.c | 2 ++ 1 file changed, 2 insertions(+)drivers/ata/pata_macio.c +0
-0drivers/ata/pata_macio.c static int pata_macio_cable_detect(struct ata_port *ap) · line 490
Quoted 8 lines
drivers/ata/pata_macio.c +2
-0@@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)struct device_node *root =of_find_node_by_path ("/" );const char *model =of_get_property (root,"model" ,NULL ); +of_node_put (root); +if (cable && !strncmp (cable,"80-" ,3 )) {/* Some drives fail to detect 80c cable in PowerBook * These machine use proprietary short IDE cable MBR, Sergei
Quoted 6 lines · Frank Lee
Quoted 3 lines · Sergei Shtylyov
Hello!
Quoted 7 lines
Quoted 7 lines · Yangtao Li
Quoted 4 lines
of_find_node_by_path()acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init()doesn't do that, so fix it.I thought we're inside
pata_macio_cable_detect()?
Hi Sergei:
Yeah,this is a typo.
Need me to resend a patch?
Thanks,
Yangtao
Quoted 28 lines
Hi Sergei:
What do you mean?
Why not release the refcount of root?Yours,
YangtaoQuoted 21 lines
Quoted 11 lines
Signed-off-by Yangtao Li <[email protected]>--- drivers/ata/pata_macio.c | 2 ++ 1 file changed, 2 insertions(+)drivers/ata/pata_macio.c +0
-0drivers/ata/pata_macio.c static int pata_macio_cable_detect(struct ata_port *ap) · line 490
Quoted 8 lines
drivers/ata/pata_macio.c +2
-0@@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)struct device_node *root =of_find_node_by_path ("/" );const char *model =of_get_property (root,"model" ,NULL ); +of_node_put (root); +if (cable && !strncmp (cable,"80-" ,3 )) {/* Some drives fail to detect 80c cable in PowerBook * These machine use proprietary short IDE cable MBR, Sergei
Quoted 9 lines · Frank Lee
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
of_find_node_by_path()acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init()doesn't do that, so fix it.I thought we're inside
pata_macio_cable_detect()?Hi Sergei:
Yeah,this is a typo.
Need me to resend a patch?
This is more of a question for the libata maintainers (but I would resend).
Quoted 2 lines
Thanks,
Yangtao
MBR, Sergei
Quoted 5 lines · Yangtao Li
of_find_node_by_path()acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init()doesn't do that, so fix it.Signed-off-by Yangtao Li <[email protected]>
Quoted 9 lines
drivers/ata/pata_macio.c | 2 ++ 1 file changed, 2 insertions(+)drivers/ata/pata_macio.c +0
-0
drivers/ata/pata_macio.c static int pata_macio_cable_detect(struct ata_port *ap) · line 490
Quoted 8 lines
drivers/ata/pata_macio.c +2
-0@@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_port *ap)struct device_node *root =of_find_node_by_path ("/" );const char *model =of_get_property (root,"model" ,NULL ); +of_node_put (root); +if (cable && !strncmp (cable,"80-" ,3 )) {/* Some drives fail to detect 80c cable in PowerBook * These machine use proprietary short IDE cable
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Quoted 9 lines · Bartlomiej Zolnierkiewicz
Quoted 5 lines · Yangtao Li
of_find_node_by_path()acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init()doesn't do that, so fix it.Signed-off-by Yangtao Li <[email protected]>
Yangtao, were you going to resend this one?
Signature · 1 line
Jens Axboe
Quoted 8 lines · Jens Axboe
Quoted 6 lines · Bartlomiej Zolnierkiewicz
Quoted 4 lines · Yangtao Li
of_find_node_by_path()acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init()doesn't do that, so fix it.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Yangtao Li <[email protected]>Yangtao, were you going to resend this one?
Actually,I've rensent the v2 at Nov 22.And I just changed the changelog. Can you pick it up?
Thanks,
Yangtao
Quoted 9 lines · Frank Lee
Quoted 8 lines · Jens Axboe
Quoted 6 lines · Bartlomiej Zolnierkiewicz
Quoted 4 lines · Yangtao Li
of_find_node_by_path()acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init()doesn't do that, so fix it.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Yangtao Li <[email protected]>Yangtao, were you going to resend this one?
Actually,I've rensent the v2 at Nov 22.And I just changed the changelog. Can you pick it up?
I missed that, sorry. I'll pick it up.
Signature · 1 line
Jens Axboe