From patchwork Tue Jul 16 20:47:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 259499 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8F5162C0156 for ; Wed, 17 Jul 2013 06:50:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B03C84A09B; Tue, 16 Jul 2013 22:49:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25KTK2dTaFqO; Tue, 16 Jul 2013 22:49:33 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 32DF24A01F; Tue, 16 Jul 2013 22:48:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 122E64A037 for ; Tue, 16 Jul 2013 22:48:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c18b73suGcow for ; Tue, 16 Jul 2013 22:48:11 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by theia.denx.de (Postfix) with ESMTPS id D54DD4A01E for ; Tue, 16 Jul 2013 22:47:56 +0200 (CEST) Received: by mail-pb0-f54.google.com with SMTP id ro2so1108466pbb.27 for ; Tue, 16 Jul 2013 13:47:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=9p1UkxpW4t8m72xK3w5MK58NX+zQBrCza7oB43wZRFY=; b=oKM3zG9KsZ3bSUHoiYbhIlB0Al6fcm7aJ85jJ5kbFrupmZhVOngddSqDhRTco2UCjF CA5DXcT5sByGQXF3Y3ub9cDZ8XF8d3rA4BH+JXI4gMhMW16hEX+w8PXi7QWyAoBn98vT fDHX60pzaZwmZQ9luuGdyJG0yfJ4m72oFk0ZpwyNyyyiuTLtDjKZTZD1ZLSezfHL3K8N 74NbjNxA4NJQkb6U3UmUu4CveGCmUqIp72LBiOjdPpcuyDpg4zUrnxD8miyVpwJ3MgaD HKiMMfUrUi+trh7ef4/FofdZqvgtBKXRJNrgqiAtfFSCTdPJg/yE+k2e4aLbrfu4slP9 H08w== X-Received: by 10.66.254.135 with SMTP id ai7mr4357848pad.185.1374007675386; Tue, 16 Jul 2013 13:47:55 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPSA id pq1sm3660279pbb.26.2013.07.16.13.47.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 16 Jul 2013 13:47:54 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.80) (envelope-from ) id 1UzCA3-0000js-30; Tue, 16 Jul 2013 13:47:51 -0700 From: Troy Kisky To: marek.vasut@gmail.com Date: Tue, 16 Jul 2013 13:47:38 -0700 Message-Id: <1374007666-2749-11-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1374007666-2749-1-git-send-email-troy.kisky@boundarydevices.com> References: <1374007666-2749-1-git-send-email-troy.kisky@boundarydevices.com> X-Gm-Message-State: ALoCoQkY9ap4SuOi1a7LM0sjiZwbuLcC3coN3feslA6iYuIxYavNg0JsN4myHyoZEf1cmZaMk01E Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH RFC V1 10/18] usb: gadget: ether: return error from rx_submit if no request X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This prevents a crash if tftpboot is given a bad filename. Signed-off-by: Troy Kisky --- drivers/usb/gadget/ether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index e39714b..1542ca3 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -2401,7 +2401,8 @@ static int usb_eth_init(struct eth_device *netdev, bd_t *bd) } packet_received = 0; - rx_submit(dev, dev->rx_req, 0); + if (dev->rx_req) + rx_submit(dev, dev->rx_req, 0); return 0; fail: return -1;