lkml.org 
[lkml]   [2018]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2018-12-10 20:14    [W:0.040 / U:1.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site