diff options
author | Christophe JAILLET <[email protected]> | 2022-02-09 07:03:11 +0100 |
---|---|---|
committer | Lyude Paul <[email protected]> | 2022-05-06 17:35:00 -0400 |
commit | ab244be47a8f111bc82496a8a20c907236e37f95 (patch) | |
tree | e6339ca49a9acf1eca01c40b0f8bbb00c8bd73cf /net/unix/sysctl_net_unix.c | |
parent | 87fd2b091fb33871a7f812658a0971e8e26f903f (diff) |
drm/nouveau: Fix a potential theorical leak in nouveau_get_backlight_name()
If successful ida_simple_get() calls are not undone when needed, some
additional memory may be allocated and wasted.
Here, an ID between 0 and MAX_INT is required. If this ID is >=100, it is
not taken into account and is wasted. It should be released.
Instead of calling ida_simple_remove(), take advantage of the 'max'
parameter to require the ID not to be too big. Should it be too big, it
is not allocated and don't need to be freed.
While at it, use ida_alloc_xxx()/ida_free() instead to
ida_simple_get()/ida_simple_remove().
The latter is deprecated and more verbose.
Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces")
Signed-off-by: Christophe JAILLET <[email protected]>
Reviewed-by: Lyude Paul <[email protected]>
[Fixed formatting warning from checkpatch]
Signed-off-by: Lyude Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/9ba85bca59df6813dc029e743a836451d5173221.1644386541.git.christophe.jaillet@wanadoo.fr
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions