]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tty: sunsu: Simplify device_node cleanup by using __free
authorShresth Prasad <shresthprasad7@gmail.com>
Sat, 18 May 2024 11:40:53 +0000 (17:10 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2024 12:00:16 +0000 (14:00 +0200)
commit0bb17fdc6735517c2127ba058126dd104cb3ee30
treed63bd75536fb789d0743d24a668dc7a94669b6c7
parentc3f38fa61af77b49866b006939479069cd451173
tty: sunsu: Simplify device_node cleanup by using __free

Add `__free` function attribute to `ap` and `match` pointer
initialisations which ensure that the pointers are freed as soon as they
go out of scope, thus removing the need to manually free them using
`of_node_put`.

This also removes the need for the `goto` statement and the `rc`
variable.

Suggested-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Shresth Prasad <shresthprasad7@gmail.com>
Link: https://lore.kernel.org/r/20240518114051.18125-3-shresthprasad7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sunsu.c