Skip to content

Commit

Permalink
net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a mem…
Browse files Browse the repository at this point in the history
…ory 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: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rickard Strandqvist authored and David S. Miller committed Jun 11, 2014
1 parent a25aafa commit 655aa39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/toshiba/ps3_gelic_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 655aa39

Please sign in to comment.