summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/selftest.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-05-16 22:20:20 +0200
committerJeff Garzik <jgarzik@redhat.com>2008-05-22 11:59:34 +0200
commit9b7bfc4c4c601a5cb368751f60cac054492c45f5 (patch)
treec5cf9c6c582542ad91e2c0bf0fffab2a6f38ee43 /drivers/net/sfc/selftest.c
parentsfc: Remove redundant casts to and from void * (diff)
downloadlinux-9b7bfc4c4c601a5cb368751f60cac054492c45f5.tar.xz
linux-9b7bfc4c4c601a5cb368751f60cac054492c45f5.zip
sfc: Added checks for heap allocation failure
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/selftest.c')
-rw-r--r--drivers/net/sfc/selftest.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c
index c98f350525a7..3b2de9fe7f27 100644
--- a/drivers/net/sfc/selftest.c
+++ b/drivers/net/sfc/selftest.c
@@ -517,6 +517,8 @@ efx_test_loopback(struct efx_tx_queue *tx_queue,
state->packet_count = min(1 << (i << 2), state->packet_count);
state->skbs = kzalloc(sizeof(state->skbs[0]) *
state->packet_count, GFP_KERNEL);
+ if (!state->skbs)
+ return -ENOMEM;
state->flush = 0;
EFX_LOG(efx, "TX queue %d testing %s loopback with %d "