net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Sat, 7 Jun 2014 10:22:08 +0000 (12:22 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Jun 2014 07:13:16 +0000 (00:13 -0700)
A check on a memory allocation is checked incorrectly.

This was partly found using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/toshiba/ps3_gelic_net.c

index d899d00..bb79928 100644 (file)
@@ -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;
        }