aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-11-18 12:26:34 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-11-18 12:26:34 +0000
commit1101fbc1060badb100fe95b54dd15b10953a1b0c (patch)
tree5d541c7ef6d146db4e4b5a94b28a658300fb4933 /target
parent7387dcd0e9e2333b19af70cf6e02846eb41a2738 (diff)
downloadupstream-1101fbc1060badb100fe95b54dd15b10953a1b0c.tar.gz
upstream-1101fbc1060badb100fe95b54dd15b10953a1b0c.tar.bz2
upstream-1101fbc1060badb100fe95b54dd15b10953a1b0c.zip
generic: ar8216: use dynamically allocated private data in ar8216_probe
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34242 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c15
1 files 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 4df2dbbdb5..5a8a938189 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