diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-11-25 16:22:41 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-11-25 16:22:41 +0000 |
commit | 5a99bed4849aef5337aee6d8d321e4a079f9794e (patch) | |
tree | 82e44be073b94e29f5034455c783a09bc06e5856 /target/linux/generic | |
parent | ac5b6d288eb6d12aaa09a889deb3df8b77cd7537 (diff) | |
download | upstream-5a99bed4849aef5337aee6d8d321e4a079f9794e.tar.gz upstream-5a99bed4849aef5337aee6d8d321e4a079f9794e.tar.bz2 upstream-5a99bed4849aef5337aee6d8d321e4a079f9794e.zip |
AA: generic: ar8216: use dynamically allocated private data in ar8216_probe
Backport of r34242.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@34356 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.c | 15 |
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 |