[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181210191311.GC5482@zn.tnic>
Date: Mon, 10 Dec 2018 20:13:11 +0100
From: Borislav Petkov <bp@...en8.de>
To: Reinette Chatre <reinette.chatre@...el.com>
Cc: tglx@...utronix.de, fenghua.yu@...el.com, tony.luck@...el.com,
jithu.joseph@...el.com, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/resctrl: Fix rdt_find_domain() return value checks
On Wed, Nov 28, 2018 at 10:20:27AM -0800, Reinette Chatre wrote:
> rdt_find_domain() may return an ERR_PTR(), NULL, or a pointer to struct
> rdt_domain. It is thus required that the return value be checked for the
> possibility of an ERR_PTR as well as NULL.
Well, it returns ERR_PTR(id) but code which uses ERR_PTR passes in an -E
value, for example ERR_PTR(-EINVAL) or so, and not an id.
And that might work now if id fits within that MAX_ERRNO range - I'm
looking at include/linux/err.h - but that's still fragile.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists