Staging: solo6x10: return -EFAULT on copy_to_user errors
authorDan Carpenter <error27@gmail.com>
Tue, 10 Aug 2010 06:09:05 +0000 (08:09 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Aug 2010 21:51:53 +0000 (14:51 -0700)
copy_to_user() returns the number of bytes remaining to be copied, but
we want to return a negative error code here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/solo6x10/solo6010-g723.c

index e82846c1d6c67c86ceb95ba264d959e659ed198d..82fbcb8458785b3bd0fe705b10cf947de19af3cf 100644 (file)
@@ -233,7 +233,7 @@ static int snd_solo_pcm_copy(struct snd_pcm_substream *ss, int channel,
                                   solo_pcm->g723_buf, G723_PERIOD_BYTES);
 
                if (err)
-                       return err; 
+                       return -EFAULT;
        }
 
        return 0;