[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150914155920.449b405a@lwn.net>
Date: Mon, 14 Sep 2015 15:59:20 -0600
From: Jonathan Corbet <corbet@....net>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
vince@...ter.net, eranian@...gle.com, johannes@...solutions.net,
Arnaldo Carvalho de Melo <acme@...radead.org>
Subject: Re: [PATCH RFC v3 1/6] exterr: Introduce extended syscall error
reporting
One more little thing:
> +int ext_err_copy_to_user(void __user *buf, size_t size)
> +{
[...]
> + ret = copy_to_user(buf, output, len + 1);
> +
> + kfree(output);
> +
> + if (!ret)
> + current->ext_err_code = 0;
> +
> + return ret ? ret : len + 1;
> +}
I'm pretty sure you really want something like:
return ret ? -EFAULT : (len + 1);
here.
jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists