diff options
Diffstat (limited to 'drivers/staging/cw1200/debug.c')
-rw-r--r-- | drivers/staging/cw1200/debug.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/staging/cw1200/debug.c b/drivers/staging/cw1200/debug.c index 43b2c257c57..3a8b79f7556 100644 --- a/drivers/staging/cw1200/debug.c +++ b/drivers/staging/cw1200/debug.c @@ -470,11 +470,12 @@ static const struct file_operations fops_hang = { int cw1200_debug_init(struct cw1200_common *priv) { + int ret = -ENOMEM; struct cw1200_debug_priv *d = kzalloc(sizeof(struct cw1200_debug_priv), GFP_KERNEL); priv->debug = d; if (!d) - return -ENOMEM; + return ret; d->debugfs_phy = debugfs_create_dir("cw1200", priv->hw->wiphy->debugfsdir); @@ -511,6 +512,11 @@ err: void cw1200_debug_release(struct cw1200_common *priv) { struct cw1200_debug_priv *d = priv->debug; + if (d) { + cw1200_itp_release(priv); + priv->debug = NULL; + kfree(d); + } priv->debug = NULL; if (d) { |