diff options
author | Guenter Roeck <linux@roeck-us.net> | 2021-05-21 23:04:57 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-21 23:14:48 +0300 |
commit | 78429edfeed8da0562243e876be46d700f9ed13c (patch) | |
tree | 531d728bab3f456c8bd55e08052e77400bd84e1e /drivers/misc/xilinx_sdfec.c | |
parent | b63866efa10ca5e4497f17eb3e3a03dc6929c49e (diff) | |
download | linux-78429edfeed8da0562243e876be46d700f9ed13c.tar.xz |
misc: xilinx-sdfec: Drop unnecessary NULL check after container_of
container_of() only returns NULL if the passed pointer is NULL _and_ if
the embedded element is the first element of the structure. Even if that
is the case, testing against it is misleading and possibly dangerous
because the position of the embedded element may change. In this case,
the check is unnecessary since it is known that file->private_data is
never NULL for an open file, and container_of() will therefore also
never be NULL. Drop the check.
Acked-by: Dragan Cvetic <dragan.cvetic@xilinx.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210521200457.2112041-1-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/xilinx_sdfec.c')
-rw-r--r-- | drivers/misc/xilinx_sdfec.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c index 23c8448a9c3b..d6e3c650bd11 100644 --- a/drivers/misc/xilinx_sdfec.c +++ b/drivers/misc/xilinx_sdfec.c @@ -1013,9 +1013,6 @@ static __poll_t xsdfec_poll(struct file *file, poll_table *wait) xsdfec = container_of(file->private_data, struct xsdfec_dev, miscdev); - if (!xsdfec) - return EPOLLNVAL | EPOLLHUP; - poll_wait(file, &xsdfec->waitq, wait); /* XSDFEC ISR detected an error */ |