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 d899d0072ae050d481b9d4510956bfb6146efac2..bb79928046645d62fbb238614777b00600b62b0d 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;
        }