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

Commit ab9b30cc authored by Sathya Narayanan's avatar Sathya Narayanan Committed by Jeff Garzik
Browse files

ibm_newemac: Fixes kernel crashes when speed of cable connected changes



The descriptor pointers were not initialized to NIL values, so it was
poiniting to some random addresses which was completely invalid. This
fix takes care of initializing the descriptor to NIL values and clearing
the valid descriptors on clean ring operation.

Signed-off-by: default avatarSathya Narayanan <sathyan@teamf1.com>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 77321233
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2719,6 +2719,8 @@ static int __devinit emac_probe(struct of_device *ofdev,
	/* Clean rings */
	memset(dev->tx_desc, 0, NUM_TX_BUFF * sizeof(struct mal_descriptor));
	memset(dev->rx_desc, 0, NUM_RX_BUFF * sizeof(struct mal_descriptor));
	memset(dev->tx_skb, 0, NUM_TX_BUFF * sizeof(struct sk_buff *));
	memset(dev->rx_skb, 0, NUM_RX_BUFF * sizeof(struct sk_buff *));

	/* Attach to ZMII, if needed */
	if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII) &&