From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ns.lynxeye.de ([87.118.118.114] helo=lynxeye.de) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBh7e-0007rB-QI for barebox@lists.infradead.org; Fri, 07 Feb 2014 08:49:22 +0000 Received: from tellur.localdomain (p57B5E0F6.dip0.t-ipconnect.de [87.181.224.246]) by lynxeye.de (Postfix) with ESMTPA id 7E2C818B4263 for ; Fri, 7 Feb 2014 09:47:38 +0100 (CET) From: Lucas Stach Date: Fri, 7 Feb 2014 09:48:51 +0100 Message-Id: <1391762936-2747-10-git-send-email-dev@lynxeye.de> In-Reply-To: <1391762936-2747-1-git-send-email-dev@lynxeye.de> References: <1391762936-2747-1-git-send-email-dev@lynxeye.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 09/14] usb: dfu: fix error path to avoid NULL ptr deref To: barebox@lists.infradead.org Signed-off-by: Lucas Stach --- drivers/usb/gadget/dfu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c index e15fc41..4d4c347 100644 --- a/drivers/usb/gadget/dfu.c +++ b/drivers/usb/gadget/dfu.c @@ -597,8 +597,10 @@ static int dfu_bind_config(struct usb_configuration *c) func->disable = dfu_disable; dfu->dnreq = usb_ep_alloc_request(c->cdev->gadget->ep0); - if (!dfu->dnreq) + if (!dfu->dnreq) { printf("usb_ep_alloc_request failed\n"); + goto out; + } dfu->dnreq->buf = dma_alloc(CONFIG_USBD_DFU_XFER_SIZE); dfu->dnreq->complete = dn_complete; dfu->dnreq->zero = 0; -- 1.8.5.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox