diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-11-18 12:26:34 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-11-18 12:26:34 +0000 |
commit | 4b17323b511fd7e03d52ef0fe60c8d0d895242ba (patch) | |
tree | 16d8489a599dc1ffe46a10496d1a3924461d003b /target/linux/generic/files/drivers/net | |
parent | 169e59626805e65022eb757ae0d4e4abf03de5e7 (diff) | |
download | upstream-4b17323b511fd7e03d52ef0fe60c8d0d895242ba.tar.gz upstream-4b17323b511fd7e03d52ef0fe60c8d0d895242ba.tar.bz2 upstream-4b17323b511fd7e03d52ef0fe60c8d0d895242ba.zip |
generic: ar8216: use dynamically allocated private data in ar8216_probe
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 34242
Diffstat (limited to 'target/linux/generic/files/drivers/net')
-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 |