From patchwork Mon Dec 15 11:22:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42224 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 909CE2456A for ; Mon, 15 Dec 2014 11:23:20 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id d49sf7399895eek.8 for ; Mon, 15 Dec 2014 03:23:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=TUdijPd7WaFxjG/H/XngqjYpQwbf990NskXJwAn1s4Q=; b=M2lgdEs2rWb+JuBiHodGlvjy9sDL40TIHh/KXwZQAepoTMGchXl8pdyy7MimNp++NP bzvekXoguqcJjv2q7zNY+V0DNyxvTU29sOCbROzjjHw2PpX8Yr6oi2eCzXbakeKiR2iA CXpugrY5uzwCvLXPg5lUPJfN9P3QrVj4bP4LzNnujc3xmTHqS6M5h+3vT/AnYxRMvaeK 2LP6JK4i8dHx5PqDi6Gte3Q4VA0n3E8XfGGZX3dMLMrYFdCCNPj7eEXYx0Qr7Lg68OTC o8TJN8Gb+B9zOkLmiRudvMfDgiqqGP1evHkmu8wfvzHFZfI5V6bnZRHJZQNbxJHNV/1l KFxg== X-Gm-Message-State: ALoCoQl3CD0KMBlauBzPgvKY3FW8/hmM5p2mbOagg2miaX0gk7e66bMCUnpR+BUOpM3f9RePyEiE X-Received: by 10.180.85.72 with SMTP id f8mr2743957wiz.0.1418642599778; Mon, 15 Dec 2014 03:23:19 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.132 with SMTP id lc4ls479440lab.1.gmail; Mon, 15 Dec 2014 03:23:19 -0800 (PST) X-Received: by 10.152.7.206 with SMTP id l14mr15000230laa.1.1418642599525; Mon, 15 Dec 2014 03:23:19 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id 5si10130062lat.76.2014.12.15.03.23.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 03:23:19 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id gd6so9327760lab.17 for ; Mon, 15 Dec 2014 03:23:19 -0800 (PST) X-Received: by 10.112.135.229 with SMTP id pv5mr29732381lbb.52.1418642599371; Mon, 15 Dec 2014 03:23:19 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp683513lbb; Mon, 15 Dec 2014 03:23:18 -0800 (PST) X-Received: by 10.229.203.9 with SMTP id fg9mr54356691qcb.20.1418642598049; Mon, 15 Dec 2014 03:23:18 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id j13si10253341qaa.61.2014.12.15.03.23.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 03:23:18 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y0TkA-0001YX-3i; Mon, 15 Dec 2014 11:23:14 +0000 Received: from mail-la0-f48.google.com ([209.85.215.48]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y0Tk3-0001YP-FF for lng-odp@lists.linaro.org; Mon, 15 Dec 2014 11:23:07 +0000 Received: by mail-la0-f48.google.com with SMTP id gf13so9000771lab.7 for ; Mon, 15 Dec 2014 03:23:01 -0800 (PST) X-Received: by 10.112.65.195 with SMTP id z3mr30462628lbs.36.1418642581802; Mon, 15 Dec 2014 03:23:01 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id 10sm2610673lar.24.2014.12.15.03.23.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 03:23:00 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 15 Dec 2014 14:22:54 +0300 Message-Id: <1418642574-4481-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCH] fix uninitialized buffer in pktin_dequeue X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 CID 84870 Coverity found uninitialized variable in case if classifier drops packets. Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_packet_io.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index a03eeb1..067282e 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -483,9 +483,12 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) tmp_hdr_tbl[j++] = buf_hdr; } - if (j) - queue_enq_multi(qentry, tmp_hdr_tbl, j); + if (0 == j) + return NULL; + + queue_enq_multi(qentry, tmp_hdr_tbl, j); buf_hdr = tmp_hdr_tbl[0]; + return buf_hdr; }