7 Oct
2014
7 Oct
'14
7:17 p.m.
At Tue, 7 Oct 2014 18:09:38 +0100, Mark Brown wrote:
On Tue, Oct 07, 2014 at 06:19:51PM +0200, Takashi Iwai wrote:
- struct device_node *np;
- struct device_node *np = NULL;
No, unconditional initialisations like this are worse than the problem they're trying to fix.
Which problem they're trying to fix...?
Initializing with NULL for the of_node_put() at error path is a standard idiom. An alternative fix would be to add "if (!pdata)" before of_node_put(np). But this isn't really intuitive, either (and even more error-prone, IMO).
Takashi