Re: çå: [RFC PATCH] char: misc: Init misc->list in a safe way

From: Arnd Bergmann
Date: Mon Jun 26 2017 - 10:10:26 EST


On Mon, Jun 26, 2017 at 4:00 PM, Zhongping Tan (èäå)
<Zhongping.Tan@xxxxxxxxxxxxxx> wrote:
> hi Arnd:
> Another way to describe this question, misc_register shouldn't modify the member of the miscdevice especially when return error. Let the caller to ensure the list have been initialized,
> or when return error, please don't initialize the list.

Why not? The caller should only initialize a couple of fields in the
structure (name, minor, fops, ...)
not never even look at the list entry, which is really internal to the
misc_register()/misc_unregister().

Arnd