ChangeSet 1.2181.4.58, 2005/03/24 14:45:05-08:00, [EMAIL PROTECTED]

        [PATCH] drivers/usb/core/devices.c: small corrections
        
        total_written is used at places where it can't have any value different
        from 0.
        
        This patch is partially based on findings of the Coverity checker.
        
        Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
        Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>



 devices.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)


diff -Nru a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
--- a/drivers/usb/core/devices.c        2005-03-30 15:16:27 -08:00
+++ b/drivers/usb/core/devices.c        2005-03-30 15:16:27 -08:00
@@ -460,7 +460,7 @@
                return 0;
        
        if (level > MAX_TOPO_LEVEL)
-               return total_written;
+               return 0;
        /* allocate 2^1 pages = 8K (on i386); should be more than enough for 
one device */
         if (!(pages_start = (char*) __get_free_pages(GFP_KERNEL,1)))
                 return -ENOMEM;
@@ -527,10 +527,7 @@
                        length = *nbytes;
                if (copy_to_user(*buffer, pages_start + *skip_bytes, length)) {
                        free_pages((unsigned long)pages_start, 1);
-                       
-                       if (total_written == 0)
-                               return -EFAULT;
-                       return total_written;
+                       return -EFAULT;
                }
                *nbytes -= length;
                *file_offset += length;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to