[dpdk-dev] [PATCH v1] eal: fix negative value incorrectly being used defect

Mcnamara, John john.mcnamara at intel.com
Fri Dec 11 15:40:21 CET 2015


> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Cunming Liang
> Sent: Friday, December 11, 2015 1:49 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v1] eal: fix negative value incorrectly being
> used defect
> 
> 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 <cunming.liang at intel.com>

Acked-by: John McNamara <john.mcnamara at intel.com>


More information about the dev mailing list