From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 66BDB8E71 for ; Sat, 12 Dec 2015 22:04:32 +0100 (CET) Received: by wmnn186 with SMTP id n186so74731541wmn.0 for ; Sat, 12 Dec 2015 13:04:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=o/H0LbY5HZgL6ZuWtGrUmzaXNAIfKFPC/KqeMcmFUw8=; b=x4ZcTzpGCOUBndTx3kzgSivmuzIA0AVEW/NW2Zgeur/BHEnoFlRyKkFdfrq4EPj+6Q ZZR8qhL0EZb2RADj/hQe9vFFDBB91466IYAGiR3ceun8OKQA8xHgfO04gSvZK9kzDnFi gGShgG6nyePq6v/SQOJi/n2mg07XTE2cWDK+5D5nZlZNVUcsIsYle9QLat+evfmVuAXQ UglhK1ogcoC+4q+uDpoO2MOOLdfmZ4SrwaKGbmGT32aXWColgxG7d9ibpooIKklhCy0t zrUnIRlTLTuPuW77jEq34smFoISs3DPUpsaYRpMsBovOz98DWY9KSfy3AX97Wg7wmWaI EH1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=o/H0LbY5HZgL6ZuWtGrUmzaXNAIfKFPC/KqeMcmFUw8=; b=eXRrk5xFt098ZxFLOphSsqO0pgi1Vn2/rkw6aUfKPYkjdRtGlxYaTIodaQ/v7QAeqR nIy1Qh3mLZN6ASfnTrLXdZTOiYDHxPCSlh9Bn0AIHhtEa/W/svkYR0g5T2e0M6kDl2Cm wgmK0y6t6K1iDpymozkoa7pGMXZzxCiiGRWw7xJvytwj5ATsvPfVjbv0mlS2oCPkjLcN GHH5eVLblEygV7I5NDkA/oTQU+qIJK7EK/kdrLqosVtMhHsls9/0KEOVIfxA6YgcCwVn OJtosun/Wj9S7oDrzjMePsx4HAyAKrTj8OsuAeC2IfeVv0aXAm49tTTnjiYvZuZJpjl0 5unw== X-Gm-Message-State: ALoCoQnw2U4EO9nm1u3BMrm9RGNQxAkk7x+GLcMetIy2uQDoJOcYcjfJqbMehK/9lnhFN0FzWtyCysVsJyn09YSick/P/Pur5Q== X-Received: by 10.28.104.132 with SMTP id d126mr14698610wmc.30.1449954272249; Sat, 12 Dec 2015 13:04:32 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id 200sm9106357wmn.11.2015.12.12.13.04.31 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Dec 2015 13:04:31 -0800 (PST) From: Thomas Monjalon To: Cunming Liang Date: Sat, 12 Dec 2015 22:03:15 +0100 Message-ID: <10010035.bssIcGskrK@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1449798537-3221-1-git-send-email-cunming.liang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Sat, 12 Dec 2015 21:04:32 -0000 2015-12-11 15:54, David Marchand: > 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 Applied, thanks