aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/x25_asy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan/x25_asy.c')
-rw-r--r--drivers/net/wan/x25_asy.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 8c5cfcb55826..1c540d825551 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -107,13 +107,9 @@ static struct x25_asy *x25_asy_alloc(void)
107static void x25_asy_free(struct x25_asy *sl) 107static void x25_asy_free(struct x25_asy *sl)
108{ 108{
109 /* Free all X.25 frame buffers. */ 109 /* Free all X.25 frame buffers. */
110 if (sl->rbuff) { 110 kfree(sl->rbuff);
111 kfree(sl->rbuff);
112 }
113 sl->rbuff = NULL; 111 sl->rbuff = NULL;
114 if (sl->xbuff) { 112 kfree(sl->xbuff);
115 kfree(sl->xbuff);
116 }
117 sl->xbuff = NULL; 113 sl->xbuff = NULL;
118 114
119 if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) { 115 if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) {
@@ -134,10 +130,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
134 { 130 {
135 printk("%s: unable to grow X.25 buffers, MTU change cancelled.\n", 131 printk("%s: unable to grow X.25 buffers, MTU change cancelled.\n",
136 dev->name); 132 dev->name);
137 if (xbuff != NULL) 133 kfree(xbuff);
138 kfree(xbuff); 134 kfree(rbuff);
139 if (rbuff != NULL)
140 kfree(rbuff);
141 return -ENOMEM; 135 return -ENOMEM;
142 } 136 }
143 137
@@ -169,10 +163,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
169 163
170 spin_unlock_bh(&sl->lock); 164 spin_unlock_bh(&sl->lock);
171 165
172 if (xbuff != NULL) 166 kfree(xbuff);
173 kfree(xbuff); 167 kfree(rbuff);
174 if (rbuff != NULL)
175 kfree(rbuff);
176 return 0; 168 return 0;
177} 169}
178 170