Re: [PATCH] vt: initialize con_driver->node in con_init

From: Wang YanQing
Date: Mon Feb 10 2014 - 19:50:47 EST


On Fri, Feb 07, 2014 at 08:45:00AM -0800, Greg KH wrote:
> On Mon, Dec 30, 2013 at 11:11:02AM +0800, Wang YanQing wrote:
> > Commit 6db4063c5b72b46e9793b0f141a7a3984ac6facf
> > ("[PATCH] VT binding: Add sysfs control to the VT layer")
> > add node item into struct con_driver.
>
> That commit was almost a decade ago, is this patch really needed?
>
> > This patch initialize con_driver->node in con_init.
>
> You are saying what it does, not _why_ it is needed or why this change
> is happening.
>
> Please rewrite this with more information because as-is, I have no idea
> why I should accept this patch.

This patch meet the same situation with another patch I sended
("[PATCH v2]vt: fix potential dual con_driver register for conswitchp"),
if conswitchp in con_init is always the first con_driver we register,
then no problem will happen due to node will be initialized to zero.

But if it isn't the first, we get trouble due to use uninitialized value
of con_driver->node.

At least the code in con_init is not perfect, if we make sure con_driver
is always the first con_driver, then we don't need for(;;), just use
registered_con_driver[0] is enough.

Ok, if this two patches really don't fix any problem, it will protect you
from seeing *the same uselss patches* in your inbox again at least I think:).

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/