From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760123Ab2FEIbP (ORCPT ); Tue, 5 Jun 2012 04:31:15 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:29130 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757344Ab2FEIbM (ORCPT ); Tue, 5 Jun 2012 04:31:12 -0400 Date: Tue, 5 Jun 2012 11:31:03 +0300 From: Dan Carpenter To: Dimitrios Semitsoglou-Tsiapos Cc: Greg KH , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] staging: comedi: cb_pcidas64: Fixed an if-statement check Message-ID: <20120605083102.GC4400@mwanda> References: <1338229715-2730-1-git-send-email-dimitrios.semitsoglou@gmail.com> <1338241905-24327-1-git-send-email-dimitrios.semitsoglou@gmail.com> <1338241905-24327-2-git-send-email-dimitrios.semitsoglou@gmail.com> <20120605034318.GA28810@kroah.com> <20120605081751.GA25855@remilia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120605081751.GA25855@remilia> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 05, 2012 at 11:17:51AM +0300, Dimitrios Semitsoglou-Tsiapos wrote: > On Mon, Jun 04, 2012 at 08:43:18PM -0700, Greg KH wrote: > > On Tue, May 29, 2012 at 12:51:45AM +0300, Dimitrios Semitsoglou-Tsiapos wrote: > > > Fixed in if-statemnt responsible for a sanity check inside the > > > prep_ao_dma function. > > > > > > Signed-off-by: Dimitrios Semitsoglou-Tsiapos > > > --- > > > drivers/staging/comedi/drivers/cb_pcidas64.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c > > > index 6f7fd99..a2e6f96 100644 > > > --- a/drivers/staging/comedi/drivers/cb_pcidas64.c > > > +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c > > > @@ -3392,8 +3392,8 @@ static int prep_ao_dma(struct comedi_device *dev, const struct comedi_cmd *cmd) > > > num_bytes = load_ao_dma_buffer(dev, cmd); > > > if (num_bytes == 0) > > > return -1; > > > - if (num_bytes >= DMA_BUFFER_SIZE) ; > > > - load_ao_dma(dev, cmd); > > > + if (num_bytes >= DMA_BUFFER_SIZE) > > > + load_ao_dma(dev, cmd); > > > > Are you sure about this change? I think someone forgot to include an > > error check here, the driver was working with this function always being > > called, and now you only do it for the extreme case. > > > > Have you checked it somehow? > > > > thanks, > > > > greg k-h > You are correct. I had misread load_ao_dma's loop as a while loop. > I'm afraid I did not have a way to test this and it does seem that it > should *not* be included. It's hard to say, I think your patch is probably correct. It sort of matches the do while loop in load_ao_dma(). But it's best if someone could test this. regards, dan carpenter