提交 655aa393 编写于 作者: R Rickard Strandqvist 提交者: David S. Miller

net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation

A check on a memory allocation is checked incorrectly.

This was partly found using a static code analysis program called cppcheck.
Signed-off-by: NRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: NGeoff Levand <geoff@infradead.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a25aafaa
......@@ -1561,7 +1561,7 @@ static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev)
* alloc netdev
*/
*netdev = alloc_etherdev(sizeof(struct gelic_port));
if (!netdev) {
if (!*netdev) {
kfree(card->unalign);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册