Commit e02fed16 authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman

staging: gasket: core: use bool type for ns_capable result

When gasket core was converted from using capable() to use ns_capable()
instead, the type of the variable holding the result should have been
converted from int to bool.
Reported-by: default avatarDmitry Torokhov <dtor@chromium.org>
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4287dbaa
...@@ -1191,7 +1191,7 @@ static int gasket_open(struct inode *inode, struct file *filp) ...@@ -1191,7 +1191,7 @@ static int gasket_open(struct inode *inode, struct file *filp)
struct gasket_cdev_info *dev_info = struct gasket_cdev_info *dev_info =
container_of(inode->i_cdev, struct gasket_cdev_info, cdev); container_of(inode->i_cdev, struct gasket_cdev_info, cdev);
struct pid_namespace *pid_ns = task_active_pid_ns(current); struct pid_namespace *pid_ns = task_active_pid_ns(current);
int is_root = ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN); bool is_root = ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN);
gasket_dev = dev_info->gasket_dev_ptr; gasket_dev = dev_info->gasket_dev_ptr;
driver_desc = gasket_dev->internal_desc->driver_desc; driver_desc = gasket_dev->internal_desc->driver_desc;
...@@ -1270,7 +1270,7 @@ static int gasket_release(struct inode *inode, struct file *file) ...@@ -1270,7 +1270,7 @@ static int gasket_release(struct inode *inode, struct file *file)
struct gasket_cdev_info *dev_info = struct gasket_cdev_info *dev_info =
container_of(inode->i_cdev, struct gasket_cdev_info, cdev); container_of(inode->i_cdev, struct gasket_cdev_info, cdev);
struct pid_namespace *pid_ns = task_active_pid_ns(current); struct pid_namespace *pid_ns = task_active_pid_ns(current);
int is_root = ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN); bool is_root = ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN);
gasket_dev = dev_info->gasket_dev_ptr; gasket_dev = dev_info->gasket_dev_ptr;
driver_desc = gasket_dev->internal_desc->driver_desc; driver_desc = gasket_dev->internal_desc->driver_desc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment