In that case, it's your fault for defining two versions of a function (inline and non-inline) that do different things.
struct tun_struct *tun = __tun_get(tfile);
struct sock *sk = tun->sk;
unsigned int mask = 0;
if (!tun)
return POLLERR;