summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/zaptel.c b/zaptel.c
index 141ca96..207fe94 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -2499,7 +2499,8 @@ static int zt_common_ioctl(struct inode *node, struct file *file, unsigned int c
!memcmp(chans[i]->txgain, defgain, 256)) {
/* This is really just a normal gain, so
deallocate the memory and go back to defaults */
- kfree(chans[i]->rxgain);
+ if (chans[i]->gainalloc)
+ kfree(chans[i]->rxgain);
chans[i]->rxgain = defgain;
chans[i]->txgain = defgain;
chans[i]->gainalloc = 0;