[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180721133507.95599-7-toddpoynor@gmail.com>
Date: Sat, 21 Jul 2018 06:34:59 -0700
From: Todd Poynor <toddpoynor@...il.com>
To: Rob Springer <rspringer@...gle.com>,
John Joseph <jnjoseph@...gle.com>,
Ben Chan <benchan@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Zhongze Hu <frankhu@...omium.org>,
Dmitry Torokhov <dtor@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Todd Poynor <toddpoynor@...gle.com>
Subject: [PATCH 06/14] staging: gasket: remove unnecessary NULL checks on calls from VFS
From: Todd Poynor <toddpoynor@...gle.com>
Remove unneeded checks for NULL pointers in struct file pointers passed
from the VFS layer or the private_data that must have been properly set
at file open time.
Reported-by: Guenter Roeck <groeck@...omium.org>
Signed-off-by: Todd Poynor <toddpoynor@...gle.com>
---
drivers/staging/gasket/gasket_core.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 11ab049854493..e82f8ce39c9fd 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1587,11 +1587,6 @@ static int gasket_mmap(struct file *filp, struct vm_area_struct *vma)
int num_map_regions = 0;
enum do_map_region_status map_status;
- if (!gasket_dev) {
- gasket_nodev_error("Unable to retrieve device data");
- trace_gasket_mmap_exit(-EINVAL);
- return -EINVAL;
- }
driver_desc = gasket_dev->internal_desc->driver_desc;
if (vma->vm_start & ~PAGE_MASK) {
@@ -1785,17 +1780,7 @@ static long gasket_ioctl(struct file *filp, uint cmd, ulong arg)
void __user *argp = (void __user *)arg;
char path[256];
- if (!filp)
- return -ENODEV;
-
gasket_dev = (struct gasket_dev *)filp->private_data;
- if (!gasket_dev) {
- gasket_nodev_error(
- "Unable to find Gasket structure for file %s",
- d_path(&filp->f_path, path, 256));
- return -ENODEV;
- }
-
driver_desc = gasket_dev->internal_desc->driver_desc;
if (!driver_desc) {
gasket_log_error(
--
2.18.0.233.g985f88cf7e-goog
Powered by blists - more mailing lists