]> git.baikalelectronics.ru Git - kernel.git/commit
counter: fix an IS_ERR() vs NULL bug
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 11 Jan 2022 17:32:43 +0000 (20:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Jan 2022 18:40:33 +0000 (19:40 +0100)
commite8b0336a6f9ed7797b3dace8361f22e7324dcc4b
treea9200a557d53d03ce47e29626d9984938faf405c
parentd62232f8afb6f710e7b2c1a39995e21aeb598419
counter: fix an IS_ERR() vs NULL bug

There are 8 callers for devm_counter_alloc() and they all check for NULL
instead of error pointers.  I think NULL is the better thing to return
for allocation functions so update counter_alloc() and devm_counter_alloc()
to return NULL instead of error pointers.

Fixes: e3ced37a8502 ("counter: Provide alternative counter registration functions")
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220111173243.GA2192@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/counter/counter-core.c