From: Takashi Iwai Subject: Re: [PATCH 07/10] ALSA: rme96: Return error code in PCM copy ops Date: Fri, 15 Nov 2013 10:53:30 +0100 Message-ID: References: <1383062433-9388-1-git-send-email-tiwai@suse.de> <1383062433-9388-8-git-send-email-tiwai@suse.de> <5285EBF7.7080109@t-online.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 9BC9E26030E for ; Fri, 15 Nov 2013 10:53:30 +0100 (CET) In-Reply-To: <5285EBF7.7080109@t-online.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Knut Petersen Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 15 Nov 2013 10:40:07 +0100, Knut Petersen wrote: > > On 29.10.2013 17:00, Takashi Iwai wrote: > > Just pass the error code returned from copy_from_user_toio() and > > copy_to_user_fromio() helpers. > > > > Spotted by coverity CID 114119. > > > > Signed-off-by: Takashi Iwai > > --- > > sound/pci/rme96.c | 10 ++++------ > > 1 file changed, 4 insertions(+), 6 deletions(-) > > > > diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c > > index bb9ebc5543d7..0236363c301f 100644 > > --- a/sound/pci/rme96.c > > +++ b/sound/pci/rme96.c > > @@ -350,9 +350,8 @@ snd_rme96_playback_copy(struct snd_pcm_substream *substream, > > struct rme96 *rme96 = snd_pcm_substream_chip(substream); > > count <<= rme96->playback_frlog; > > pos <<= rme96->playback_frlog; > > - copy_from_user_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos, src, > > - count); > > - return 0; > > + return copy_from_user_toio(rme96->iobase + RME96_IO_PLAY_BUFFER + pos, src, > > + count); > > Under which circumstances could copy_from_user_toio() fail? When copy_from_user() fails. > > } > > > > static int > > @@ -365,9 +364,8 @@ snd_rme96_capture_copy(struct snd_pcm_substream *substream, > > struct rme96 *rme96 = snd_pcm_substream_chip(substream); > > count <<= rme96->capture_frlog; > > pos <<= rme96->capture_frlog; > > - copy_to_user_fromio(dst, rme96->iobase + RME96_IO_REC_BUFFER + pos, > > - count); > > - return 0; > > + return copy_to_user_fromio(dst, rme96->iobase + RME96_IO_REC_BUFFER + pos, > > + count); > When will copy_to_user_fromio() fail? When copy_to_user() fails. Takashi