* Description: this function checks the HW capability
* (if supported) and sets the driver's features.
*/
-static void sxgbe_hw_init(struct sxgbe_priv_data * const priv)
+static int sxgbe_hw_init(struct sxgbe_priv_data * const priv)
{
u32 ctrl_ids;
priv->hw = kmalloc(sizeof(*priv->hw), GFP_KERNEL);
+ if(!priv->hw)
+ return -ENOMEM;
/* get the hardware ops */
sxgbe_get_ops(priv->hw);
if (priv->hw_cap.rx_csum_offload)
pr_info("RX Checksum offload supported\n");
+
+ return 0;
}
/**
sxgbe_verify_args();
/* Init MAC and get the capabilities */
- sxgbe_hw_init(priv);
+ ret = sxgbe_hw_init(priv);
+ if (ret)
+ goto error_free_netdev;
/* allocate memory resources for Descriptor rings */
ret = txring_mem_alloc(priv);