lkml.org 
[lkml]   [2018]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] proc: fix /proc/*/map_files lookup some more
On Wed, Feb 21, 2018 at 12:04:03PM -0800, Andrew Morton wrote:
>
> I don't know this code and I'm all confused.
>
> - why is the code designed to accept addresses of "0"?

It was never designed to accept addresses of 0, it is rather
a side effect of using sscanf in first place.

The address priting is done via

len = snprintf(buf, sizeof(buf), "%lx-%lx", p->start, p->end);

> - how do we know that the first digit of a VMA address will never be 0?

It should not be, due to snprintf above.
---

Thanks a lot, Alexey!

Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>

\
 
 \ /
  Last update: 2018-02-21 21:29    [W:0.099 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site