Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b7bfc4c authored by Ben Hutchings's avatar Ben Hutchings Committed by Jeff Garzik
Browse files

sfc: Added checks for heap allocation failure

parent d3208b5e
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -517,6 +517,8 @@ efx_test_loopback(struct efx_tx_queue *tx_queue,
		state->packet_count = min(1 << (i << 2), state->packet_count);
		state->packet_count = min(1 << (i << 2), state->packet_count);
		state->skbs = kzalloc(sizeof(state->skbs[0]) *
		state->skbs = kzalloc(sizeof(state->skbs[0]) *
				      state->packet_count, GFP_KERNEL);
				      state->packet_count, GFP_KERNEL);
		if (!state->skbs)
			return -ENOMEM;
		state->flush = 0;
		state->flush = 0;


		EFX_LOG(efx, "TX queue %d testing %s loopback with %d "
		EFX_LOG(efx, "TX queue %d testing %s loopback with %d "
+2 −0
Original line number Original line Diff line number Diff line
@@ -211,6 +211,8 @@ static int tenxpress_phy_init(struct efx_nic *efx)
	int rc = 0;
	int rc = 0;


	phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL);
	phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL);
	if (!phy_data)
		return -ENOMEM;
	efx->phy_data = phy_data;
	efx->phy_data = phy_data;


	tenxpress_set_state(efx, TENXPRESS_STATUS_NORMAL);
	tenxpress_set_state(efx, TENXPRESS_STATUS_NORMAL);
+2 −0
Original line number Original line Diff line number Diff line
@@ -85,6 +85,8 @@ static int xfp_phy_init(struct efx_nic *efx)
	int rc;
	int rc;


	phy_data = kzalloc(sizeof(struct xfp_phy_data), GFP_KERNEL);
	phy_data = kzalloc(sizeof(struct xfp_phy_data), GFP_KERNEL);
	if (!phy_data)
		return -ENOMEM;
	efx->phy_data = phy_data;
	efx->phy_data = phy_data;


	EFX_INFO(efx, "XFP: PHY ID reg %x (OUI %x model %x revision"
	EFX_INFO(efx, "XFP: PHY ID reg %x (OUI %x model %x revision"