aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorXiyu Yang <[email protected]>2021-07-19 13:59:45 +0800
committerSam Ravnborg <[email protected]>2021-07-19 22:16:35 +0200
commit0189cb57b96ff92f75e3680b3710a46dacd6509f (patch)
treebb892fadc63bdafc3f10444a2faa97b9b40a354e /include/linux
parent98a65439172dc69cb16834e62e852afc2adb83ed (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 <[email protected]> Signed-off-by: Xin Tan <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fb.h3
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;
/*