diff options
author | Adrian Bunk <bunk@kernel.org> | 2007-10-18 06:53:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-25 15:18:43 -0400 |
commit | 3328d9752f3796a5f5f8695d27a175c34407a5ed (patch) | |
tree | e97145e9cec05cffecd2cbd296a479404098146f /drivers/usb | |
parent | e28c6a77061ab28bd2f0b57e400e3e58cd3474ca (diff) |
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/misc/rio500.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index 88f6abe73624..330c18e390b8 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c | |||
@@ -118,10 +118,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned int cmd, | |||
118 | 118 | ||
119 | mutex_lock(&(rio->lock)); | 119 | mutex_lock(&(rio->lock)); |
120 | /* Sanity check to make sure rio is connected, powered, etc */ | 120 | /* Sanity check to make sure rio is connected, powered, etc */ |
121 | if ( rio == NULL || | 121 | if (rio->present == 0 || rio->rio_dev == NULL) { |
122 | rio->present == 0 || | ||
123 | rio->rio_dev == NULL ) | ||
124 | { | ||
125 | retval = -ENODEV; | 122 | retval = -ENODEV; |
126 | goto err_out; | 123 | goto err_out; |
127 | } | 124 | } |
@@ -280,10 +277,7 @@ write_rio(struct file *file, const char __user *buffer, | |||
280 | if (intr) | 277 | if (intr) |
281 | return -EINTR; | 278 | return -EINTR; |
282 | /* Sanity check to make sure rio is connected, powered, etc */ | 279 | /* Sanity check to make sure rio is connected, powered, etc */ |
283 | if ( rio == NULL || | 280 | if (rio->present == 0 || rio->rio_dev == NULL) { |
284 | rio->present == 0 || | ||
285 | rio->rio_dev == NULL ) | ||
286 | { | ||
287 | mutex_unlock(&(rio->lock)); | 281 | mutex_unlock(&(rio->lock)); |
288 | return -ENODEV; | 282 | return -ENODEV; |
289 | } | 283 | } |
@@ -369,10 +363,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) | |||
369 | if (intr) | 363 | if (intr) |
370 | return -EINTR; | 364 | return -EINTR; |
371 | /* Sanity check to make sure rio is connected, powered, etc */ | 365 | /* Sanity check to make sure rio is connected, powered, etc */ |
372 | if ( rio == NULL || | 366 | if (rio->present == 0 || rio->rio_dev == NULL) { |
373 | rio->present == 0 || | ||
374 | rio->rio_dev == NULL ) | ||
375 | { | ||
376 | mutex_unlock(&(rio->lock)); | 367 | mutex_unlock(&(rio->lock)); |
377 | return -ENODEV; | 368 | return -ENODEV; |
378 | } | 369 | } |