[PATCH] Fix address space ordering problem
commit7a312ea52f7bac609b385b047095d08fd0f5d803
authorviro@ZenIV.linux.org.uk <viro@ZenIV.linux.org.uk>
Fri, 9 Sep 2005 17:29:38 +0000 (9 18:29 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 17:47:42 +0000 (9 10:47 -0700)
tree61f3a892a2ca5254bb1b90a565b9e918fdc0e924
parent5240b8c7661323db17198f60b16866032c1922d2
[PATCH] Fix address space ordering problem

We used to get "__user void *" wrong - it ended up with address space 0
instead of address space 1.

What happens is actually pretty simple - we get address_space(1) handled
in declaration_specifiers(), which sets ctype->as to 1.  Then we see
"void" and eventually get to

                        ctype->base_type = type;
                }

                check_modifiers(&token->pos, s, ctype->modifiers);
                apply_ctype(token->pos, &thistype, ctype);

with thistype coming from lookup for "void".  And that, of course, has
zero ->as.  Now apply_ctype merrily buggers ctype->as and we have 0...

So AFAICS proper fix for sparse should be to check thistype->as to see
if it really has any intention to change ->as.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
parse.c