lkml.org 
[lkml]   [2021]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-12-29 13:08    [W:0.078 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site