|
@@ -54,15 +54,13 @@ void ax25_rt_device_down(struct net_device *dev)
|
|
if (s->dev == dev) {
|
|
if (s->dev == dev) {
|
|
if (ax25_route_list == s) {
|
|
if (ax25_route_list == s) {
|
|
ax25_route_list = s->next;
|
|
ax25_route_list = s->next;
|
|
- if (s->digipeat != NULL)
|
|
|
|
- kfree(s->digipeat);
|
|
|
|
|
|
+ kfree(s->digipeat);
|
|
kfree(s);
|
|
kfree(s);
|
|
} else {
|
|
} else {
|
|
for (t = ax25_route_list; t != NULL; t = t->next) {
|
|
for (t = ax25_route_list; t != NULL; t = t->next) {
|
|
if (t->next == s) {
|
|
if (t->next == s) {
|
|
t->next = s->next;
|
|
t->next = s->next;
|
|
- if (s->digipeat != NULL)
|
|
|
|
- kfree(s->digipeat);
|
|
|
|
|
|
+ kfree(s->digipeat);
|
|
kfree(s);
|
|
kfree(s);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -90,10 +88,8 @@ static int ax25_rt_add(struct ax25_routes_struct *route)
|
|
while (ax25_rt != NULL) {
|
|
while (ax25_rt != NULL) {
|
|
if (ax25cmp(&ax25_rt->callsign, &route->dest_addr) == 0 &&
|
|
if (ax25cmp(&ax25_rt->callsign, &route->dest_addr) == 0 &&
|
|
ax25_rt->dev == ax25_dev->dev) {
|
|
ax25_rt->dev == ax25_dev->dev) {
|
|
- if (ax25_rt->digipeat != NULL) {
|
|
|
|
- kfree(ax25_rt->digipeat);
|
|
|
|
- ax25_rt->digipeat = NULL;
|
|
|
|
- }
|
|
|
|
|
|
+ kfree(ax25_rt->digipeat);
|
|
|
|
+ ax25_rt->digipeat = NULL;
|
|
if (route->digi_count != 0) {
|
|
if (route->digi_count != 0) {
|
|
if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
|
|
if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {
|
|
write_unlock(&ax25_route_lock);
|
|
write_unlock(&ax25_route_lock);
|
|
@@ -145,8 +141,7 @@ static int ax25_rt_add(struct ax25_routes_struct *route)
|
|
static void ax25_rt_destroy(ax25_route *ax25_rt)
|
|
static void ax25_rt_destroy(ax25_route *ax25_rt)
|
|
{
|
|
{
|
|
if (atomic_read(&ax25_rt->ref) == 0) {
|
|
if (atomic_read(&ax25_rt->ref) == 0) {
|
|
- if (ax25_rt->digipeat != NULL)
|
|
|
|
- kfree(ax25_rt->digipeat);
|
|
|
|
|
|
+ kfree(ax25_rt->digipeat);
|
|
kfree(ax25_rt);
|
|
kfree(ax25_rt);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -530,9 +525,7 @@ void __exit ax25_rt_free(void)
|
|
s = ax25_rt;
|
|
s = ax25_rt;
|
|
ax25_rt = ax25_rt->next;
|
|
ax25_rt = ax25_rt->next;
|
|
|
|
|
|
- if (s->digipeat != NULL)
|
|
|
|
- kfree(s->digipeat);
|
|
|
|
-
|
|
|
|
|
|
+ kfree(s->digipeat);
|
|
kfree(s);
|
|
kfree(s);
|
|
}
|
|
}
|
|
write_unlock(&ax25_route_lock);
|
|
write_unlock(&ax25_route_lock);
|