From 42670d4d0fe615ba550abc067df90e4d75c04e22 Mon Sep 17 00:00:00 2001 From: juhosg Date: Sun, 18 Nov 2012 12:26:34 +0000 Subject: generic: ar8216: use dynamically allocated private data in ar8216_probe Signed-off-by: Gabor Juhos git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34242 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/generic/files/drivers/net/phy/ar8216.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 4df2dbbdb..5a8a93818 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -1481,10 +1481,19 @@ ar8216_config_aneg(struct phy_device *phydev) static int ar8216_probe(struct phy_device *pdev) { - struct ar8216_priv priv; + struct ar8216_priv *priv; + int ret; + + priv = kzalloc(sizeof(struct ar8216_priv), GFP_KERNEL); + if (priv == NULL) + return -ENOMEM; + + priv->phy = pdev; - priv.phy = pdev; - return ar8216_id_chip(&priv); + ret = ar8216_id_chip(priv); + kfree(priv); + + return ret; } static void -- cgit v1.2.3