Input: i8042 fix refcount leak
Subsystems (2)
PATCH v2 1/1 Input: i8042 fix refcount leak
use of_node_put() to release the refcount.
--- drivers/input/serio/i8042-sparcio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/input/serio/i8042-sparcio.h +5 -1
@@ -111,13 +111,17 @@ static int __init i8042_platform_init(void)struct device_node *root =of_find_node_by_path ("/" );if (!strcmp (root->name,"SUNW,JavaStation-1" )) { +of_node_put (root);/* Hardcoded values for MrCoffee. */ i8042_kbd_irq = i8042_aux_irq =13 |0x20 ; kbd_iobase =ioremap (0x71300060 ,8 );if (!kbd_iobase)return -ENODEV ; }else { -int err =platform_driver_register (&sparc_i8042_driver); +int err; + +of_node_put (root); + err =platform_driver_register (&sparc_i8042_driver);if (err)return err;
Signature · 1 line
2.17.0
Dmitry Torokhov
maintainerQuoted 19 lines · Yangtao Li
use
of_node_put()to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/input/serio/i8042-sparcio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/input/serio/i8042-sparcio.h +1
-0@@ -111,13 +111,17 @@ static int __init i8042_platform_init(void)struct device_node *root =of_find_node_by_path ("/" );if (!strcmp (root->name,"SUNW,JavaStation-1" )) { +of_node_put (root);/* Hardcoded values for MrCoffee. */ i8042_kbd_irq = i8042_aux_irq =13 |0x20 ; kbd_iobase =ioremap (0x71300060 ,8 );
drivers/input/serio/i8042-sparcio.h static int __init i8042_platform_init(void) · line 126
Quoted 10 lines
drivers/input/serio/i8042-sparcio.h +4
-1if (!kbd_iobase)return -ENODEV ; }else { -int err =platform_driver_register (&sparc_i8042_driver); +int err; + +of_node_put (root); + err =platform_driver_register (&sparc_i8042_driver);if (err)return err;
This is not really what I asked for, as in this version you left out leaky reference in i8042_platform_exit(). Please make the "detect Mr Coffee" function and use it in both i8042_platform_init() and i8042_platform_exit().
Thanks.
Signature · 1 line
Dmitry
Quoted 28 lines · Dmitry Torokhov
Quoted 26 lines · Yangtao Li
use
of_node_put()to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/input/serio/i8042-sparcio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/input/serio/i8042-sparcio.h +4
-1@@ -111,13 +111,17 @@ static int __init i8042_platform_init(void)struct device_node *root =of_find_node_by_path ("/" );if (!strcmp (root->name,"SUNW,JavaStation-1" )) { +of_node_put (root);/* Hardcoded values for MrCoffee. */ i8042_kbd_irq = i8042_aux_irq =13 |0x20 ; kbd_iobase =ioremap (0x71300060 ,8 );if (!kbd_iobase)return -ENODEV ; }else { -int err =platform_driver_register (&sparc_i8042_driver); +int err; + +of_node_put (root);
Quoted 8 lines
drivers/input/serio/i8042-sparcio.h static int __init i8042_platform_init(void) · line 126
Quoted 3 lines
drivers/input/serio/i8042-sparcio.h +1
-0+ err =platform_driver_register (&sparc_i8042_driver);if (err)return err;This is not really what I asked for, as in this version you left out leaky reference in
i8042_platform_exit(). Please make the "detect Mr Coffee" function and use it in bothi8042_platform_init()andi8042_platform_exit().
How about the newer?
Yours,
Yangtao
Quoted 5 lines
Thanks.
--
Dmitry