diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-08-05 18:34:16 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-08-05 18:34:16 +0000 |
commit | 5e6f6ca3bd0b8e0927f1d0844e26190f53051924 (patch) | |
tree | ad00cdaf02121df645120a170720c8e08e7d8cc6 /drivers/dahdi/dahdi-base.c | |
parent | fc3f6fe70b56bf98e6799f286423048649d6d8df (diff) |
Fix a small regression from r4667: Please don't NULL a good pointer.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4705 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 932e5c6..3a18631 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -853,9 +853,10 @@ static int dahdi_reallocbufs(struct dahdi_chan *ss, int j, int numbufs) numbufs = DAHDI_MAX_NUM_BUFS; /* We need to allocate our buffers now */ - if (j && !(newbuf = kcalloc(j * 2, numbufs, GFP_KERNEL))) - return -ENOMEM; - else + if (j) { + if(!(newbuf = kcalloc(j * 2, numbufs, GFP_KERNEL))) + return -ENOMEM; + } else newbuf = NULL; /* Now that we've allocated our new buffer, we can safely |