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@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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) {
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(