From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f172.google.com (mail-ob0-f172.google.com [209.85.214.172]) by dpdk.org (Postfix) with ESMTP id A441F8E71 for ; Fri, 11 Dec 2015 15:54:44 +0100 (CET) Received: by obc18 with SMTP id 18so84084918obc.2 for ; Fri, 11 Dec 2015 06:54:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=t3BmHUhUi8jEetcYO/2DTVCwQsGIx1ZG7x3AErrForI=; b=a1DOYeCKX8Nig3MVyFzBPxjGbCUoBKxbJ/2MBrPkk1R4/8jBCLC2KvB2KsJu+xWfqr Y/CFOS8inZosF895koVd9A1hQ6LZFeEb6H4MP+7I/gs6ZBGxPkzyG7natFrgvh1tZK2p Ub8t2CFvYeO96Ky+B3t4pvoqjmw8CiZgEHR8ygJmIFTCutb+HcLLDBjeJi4HNDt7aOne ZVxFhnlAXlc8EHZuZSavj9QJyhpU/+VN/4Tv3xSrQChBWpqW179Vr+8jDmYLX1DtmPR8 ZndtgWZjze9EdSViVshJQ8wX2VlpsCmdzq7xmLt56/CpHJ+h2Ac48Owzs3ZneJ28cqBW dVLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=t3BmHUhUi8jEetcYO/2DTVCwQsGIx1ZG7x3AErrForI=; b=VN1X79eRtGb2SN0Yuo6U47t79tlR3iMg3K6Npw7MTrdScz75c9StPhsFXFI8rYEuvs zQk1HG+JC27au+qf4NMyhX8eqbEqIJyqmtUvtAz1vInpS434IcDaLJm0nYXtXQQpqfX8 5V2RzwBbc6G17tqxJ1jsiANQ/tgPBq6wItViQsXfxADQomLoUeWSZWMWFBFzUqgu87BJ aiqpPnTA2vu72p+SjgdR/FV71nrjuzE+EY/cb2mROThpqd5gAJwKIbx6Qttjc3OChrJt wwgFl+3kXWWV54sIIhqNYDfB02KIv9DY0ZycqUNO0U8cgh+EseAchh5N+FGFjANCxSZy K7Ng== X-Gm-Message-State: ALoCoQkI2bDciRj1y6Q/HD1xFhP3QpAXDuwYsHjCbTH8QQLkbmcy/oM+BrUKwdrjI3SMiH0ZtxCN05Vh8CApVj5rqQ1WOpd2qtHL2X8rNL/OHwgXmOBOVE0= MIME-Version: 1.0 X-Received: by 10.182.130.234 with SMTP id oh10mr14736116obb.58.1449845684104; Fri, 11 Dec 2015 06:54:44 -0800 (PST) Received: by 10.76.153.5 with HTTP; Fri, 11 Dec 2015 06:54:44 -0800 (PST) In-Reply-To: <1449798537-3221-1-git-send-email-cunming.liang@intel.com> References: <1449798537-3221-1-git-send-email-cunming.liang@intel.com> Date: Fri, 11 Dec 2015 15:54:44 +0100 Message-ID: From: David Marchand To: Cunming Liang Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v1] eal: fix negative value incorrectly being used defect X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 14:54:45 -0000 Hello Cunming, On Fri, Dec 11, 2015 at 2:48 AM, Cunming Liang wrote: > In eal_intr_proc_rxtx_intr, negative value may be used as argument to a > function expecting a positive value. If 'read' returns EAGAIN as example, > the bytes_read updates to a negative value which continue be passed as > argument for the next 'read'. > > Coverity issue: 107115 > > 927 do { > 3. negative_return_fn: Function read(fd, &buf, bytes_read) returns a > negative number. > 4. var_assign: Assigning: signed variable bytes_read = read. > CID 107115 (#1 of 1): Argument cannot be negative > (NEGATIVE_RETURNS)9. negative_returns: bytes_read is passed to a > parameter > that cannot be negative. > 928 bytes_read = read(fd, &buf, bytes_read); > > Fixes: c9f3ec1a0f3f ("eal/linux: add Rx interrupt control function") > > Signed-off-by: Cunming Liang > Acked-by: David Marchand Thanks. -- David Marchand