<p>I am attempting to copy a custom struct from kernel space to user space. inside user space errno returns 'bad address'.  What is the usual cause of a bad address error?</p>

<pre><code>if(copy_to_user(info, &amp;kernel_info, sizeof(struct prinfo)))
</code></pre>

Bad Address error means that the address location that you have given is invalid. With the case you have above I would guess it is because you are passing a copy of
```
info
```
instead of a pointer to
```
info
```
's memory location.
Looking at the docs,
```
copy_to_user
```
is defined as
```
```
copy_to_user(void __user * to, const void * from, unsigned long n);
```
```
So unless your
```
info
```
variable is a pointer I would update your code to be:
```
```
if(copy_to_user(&info, &kernel_info, sizeof(struct prinfo)) ) {
    //some stuff here i guess
}
```
```