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)
commitfc55e63e148f1db2180867da875460a00aac8bd1
treea9200a557d53d03ce47e29626d9984938faf405c
parenta6501e4b380faee6bbf41bb2f833977c7ac6491a
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: c18e2760308e ("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