X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fax25%2Fax25_route.c;h=38c7f3087ec3d17c1fc8a5ff48be10cb9dedda60;hb=3d4d4582e5b3f67a68f2cf32fd5b70d8d80f119d;hp=0a0381622b1cb16ce7d630ae8c18d54938a8c3b2;hpb=4604096768d3be37ee1a05aee424aceed3e1b56f;p=linux-2.6 diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index 0a0381622b..38c7f3087e 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c @@ -87,7 +87,7 @@ static int __must_check ax25_rt_add(struct ax25_routes_struct *route) ax25_rt = ax25_route_list; while (ax25_rt != NULL) { if (ax25cmp(&ax25_rt->callsign, &route->dest_addr) == 0 && - ax25_rt->dev == ax25_dev->dev) { + ax25_rt->dev == ax25_dev->dev) { kfree(ax25_rt->digipeat); ax25_rt->digipeat = NULL; if (route->digi_count != 0) { @@ -249,11 +249,12 @@ int ax25_rt_ioctl(unsigned int cmd, void __user *arg) #ifdef CONFIG_PROC_FS static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos) + __acquires(ax25_route_lock) { struct ax25_route *ax25_rt; int i = 1; - - read_lock(&ax25_route_lock); + + read_lock(&ax25_route_lock); if (*pos == 0) return SEQ_START_TOKEN; @@ -269,11 +270,12 @@ static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos) static void *ax25_rt_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - return (v == SEQ_START_TOKEN) ? ax25_route_list : + return (v == SEQ_START_TOKEN) ? ax25_route_list : ((struct ax25_route *) v)->next; } static void ax25_rt_seq_stop(struct seq_file *seq, void *v) + __releases(ax25_route_lock) { read_unlock(&ax25_route_lock); } @@ -320,7 +322,7 @@ static int ax25_rt_seq_show(struct seq_file *seq, void *v) return 0; } -static struct seq_operations ax25_rt_seqops = { +static const struct seq_operations ax25_rt_seqops = { .start = ax25_rt_seq_start, .next = ax25_rt_seq_next, .stop = ax25_rt_seq_stop, @@ -332,7 +334,7 @@ static int ax25_rt_info_open(struct inode *inode, struct file *file) return seq_open(file, &ax25_rt_seqops); } -struct file_operations ax25_route_fops = { +const struct file_operations ax25_route_fops = { .owner = THIS_MODULE, .open = ax25_rt_info_open, .read = seq_read,