From patchwork Fri Oct 17 20:40:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 38997 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DD820202DB for ; Fri, 17 Oct 2014 20:41:03 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e51sf961148eek.11 for ; Fri, 17 Oct 2014 13:41:03 -0700 (PDT) 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:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=D6oMZVYgxxtoWQmwHjYA/F3ZDhSpqP8VUhlt3a9hGf4=; b=jgK0T4QCg84nPG0T98t5KsJ1IzQlA37WPPdoZfBLlO5EqKTo4ORYBJhVOLROYk209n qRjaBYbpJkHI5RB2y53GIYKWwULebrf/QzbOEodKd0YEy5s+WXODnixQ4MhYvo3twzyJ PqIHbQJxa1mWsZRcYA1Fos6YzzmuC/F4Geg7X3ee95YVpW4CWovyp90RRZ2AhBuEYUKS /yBtV49G4PtWMPBe1tgB3y4QB2SF9JRTDXPAAsD1sskskocHuEI0PfUHGXhCsZLEgMb4 vcnNrDJ7QT+ZkpZFAE/ixtYvnc+BAbAC2zyCv+VjnquFPQ7LtDcyS3ylG/OqRWYwv3vd cVpA== X-Gm-Message-State: ALoCoQlazVCWkulY9Yxs8fgBiM+Fmq2JvSDnQNKsaswy4TYnVS/xYnm9QpuUfP5kT7LrXVz4TWbg X-Received: by 10.194.241.232 with SMTP id wl8mr6568wjc.5.1413578463050; Fri, 17 Oct 2014 13:41:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.41 with SMTP id s9ls295631lae.41.gmail; Fri, 17 Oct 2014 13:41:02 -0700 (PDT) X-Received: by 10.112.95.133 with SMTP id dk5mr11423639lbb.53.1413578462856; Fri, 17 Oct 2014 13:41:02 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id cy2si3752629lac.26.2014.10.17.13.41.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 13:41:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id pv20so1314243lab.20 for ; Fri, 17 Oct 2014 13:41:02 -0700 (PDT) X-Received: by 10.112.167.38 with SMTP id zl6mr11296362lbb.34.1413578462722; Fri, 17 Oct 2014 13:41:02 -0700 (PDT) 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.84.229 with SMTP id c5csp300731lbz; Fri, 17 Oct 2014 13:41:02 -0700 (PDT) X-Received: by 10.229.102.72 with SMTP id f8mr15809894qco.9.1413578461278; Fri, 17 Oct 2014 13:41:01 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id w19si4325147qaw.18.2014.10.17.13.41.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Oct 2014 13:41:01 -0700 (PDT) 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 1XfEKZ-0008Bz-Fd; Fri, 17 Oct 2014 20:40:59 +0000 Received: from mail-qg0-f49.google.com ([209.85.192.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XfEKT-0008Bu-So for lng-odp@lists.linaro.org; Fri, 17 Oct 2014 20:40:53 +0000 Received: by mail-qg0-f49.google.com with SMTP id e89so1109097qgf.8 for ; Fri, 17 Oct 2014 13:40:48 -0700 (PDT) X-Received: by 10.229.102.72 with SMTP id f8mr15808391qco.9.1413578448667; Fri, 17 Oct 2014 13:40:48 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id g51sm1730519qge.18.2014.10.17.13.40.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Oct 2014 13:40:47 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 17 Oct 2014 16:40:39 -0400 Message-Id: <1413578439-22781-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] odp_packet_socket.c: Fix call to bind with negative fd 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: mike.holmes@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.47 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 Failure from the socket create call should propagate up and not be passed into bind. Signed-off-by: Mike Holmes --- platform/linux-generic/odp_packet_socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index da9b5a0..0492d1e 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -829,6 +829,8 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const pkt_sock, const char *netdev, pkt_sock->pool = pool; pkt_sock->sockfd = mmap_pkt_socket(); + if (pkt_sock->sockfd == -1) + return -1; ret = mmap_bind_sock(pkt_sock, netdev); if (ret != 0)