diff options
author | Xiyu Yang | 2021-07-19 13:59:45 +0800 |
---|---|---|
committer | Sam Ravnborg | 2021-07-19 22:16:35 +0200 |
commit | 0189cb57b96ff92f75e3680b3710a46dacd6509f (patch) | |
tree | bb892fadc63bdafc3f10444a2faa97b9b40a354e /include | |
parent | 98a65439172dc69cb16834e62e852afc2adb83ed (diff) |
fbmem: Convert from atomic_t to refcount_t on fb_info->count
refcount_t type and corresponding API can protect refcounters from
accidental underflow and overflow and further use-after-free situations.
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1626674392-55857-1-git-send-email-xiyuyang19@fudan.edu.cn
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fb.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h index a8dccd23c249..9023739e9a42 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -2,6 +2,7 @@ #ifndef _LINUX_FB_H #define _LINUX_FB_H +#include <linux/refcount.h> #include <linux/kgdb.h> #include <uapi/linux/fb.h> @@ -435,7 +436,7 @@ struct fb_tile_ops { struct fb_info { - atomic_t count; + refcount_t count; int node; int flags; /* |