[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211229120723.y5dlbmbvmg4ogq26@pengutronix.de>
Date: Wed, 29 Dec 2021 13:07:23 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Lars-Peter Clausen <lars@...afoo.de>, linux-iio@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
William Breathitt Gray <vilhelm.gray@...il.com>,
linux-kernel@...r.kernel.org, kernel@...gutronix.de,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v2 13/23] counter: Provide alternative counter
registration functions
Hello,
On Wed, Dec 29, 2021 at 12:27:32PM +0100, Uwe Kleine-König wrote:
> > Personal inclination here would be to keep the elements in here
> > in the same order as in counter_register() where it doesn't matter
> > in the interests of slightly easier comparison of the code.
>
> I reordered a bit because counter_register fails to undo ida_alloc() in
> the error path. However I might have missed that some initialisation has
> to be done before calling counter_chrdev_add().
Another issue in counter_register() is: If counter_sysfs_add() fails,
put_device() is called which eventually calls counter_device_release()
-> counter_chrdev_remove() -> kfifo_free(). I think it's not a real
problem, but it's ugly because because counter_chrdev_add()
-> kfifo_alloc() wasn't called yet.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists