USB rio500.c: fix check-after-use
The Coverity checker spotted that we have already oops'ed if "dev"
was NULL in these places.
Since "dev" being NULL isn't possible at these places this patch removes
the NULL checks.
Additionally, I've fixed the formatting of the if's.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
index 88f6abe..330c18e 100644
--- a/drivers/usb/misc/rio500.c
+++ b/drivers/usb/misc/rio500.c
@@ -118,10 +118,7 @@
mutex_lock(&(rio->lock));
/* Sanity check to make sure rio is connected, powered, etc */
- if ( rio == NULL ||
- rio->present == 0 ||
- rio->rio_dev == NULL )
- {
+ if (rio->present == 0 || rio->rio_dev == NULL) {
retval = -ENODEV;
goto err_out;
}
@@ -280,10 +277,7 @@
if (intr)
return -EINTR;
/* Sanity check to make sure rio is connected, powered, etc */
- if ( rio == NULL ||
- rio->present == 0 ||
- rio->rio_dev == NULL )
- {
+ if (rio->present == 0 || rio->rio_dev == NULL) {
mutex_unlock(&(rio->lock));
return -ENODEV;
}
@@ -369,10 +363,7 @@
if (intr)
return -EINTR;
/* Sanity check to make sure rio is connected, powered, etc */
- if ( rio == NULL ||
- rio->present == 0 ||
- rio->rio_dev == NULL )
- {
+ if (rio->present == 0 || rio->rio_dev == NULL) {
mutex_unlock(&(rio->lock));
return -ENODEV;
}