From: Rasmus Villemoes <li...@rasmusvillemoes.dk> Date: Mon, 9 Nov 2015 13:19:10 +0100
> I don't know if dev can actually be NULL here, but the test should be > above alloc_netdev(), to avoid leaking the struct net_device in case > dev is actually NULL. And of course the return value from alloc_netdev > should be tested. > > Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> > --- > Maybe the existing code was supposed to be "if (!ndev)", and dev > cannot be NULL, but then -ENODEV is a slightly odd return > value. Doing both tests seems to be the safe choice. This is made painfully impossible to figure out because there seems to be no in-tree code instantiating platform_device objects for this caif_spi framework, nor are there even in-tree implementations of the init_xfer et al. required methods. So your fix is as good as any, applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html