{"id":662891,"url":"http://patchwork.ozlabs.org/api/patches/662891/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20160825173947.26624-12-wsa-dev@sang-engineering.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<20160825173947.26624-12-wsa-dev@sang-engineering.com>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/20160825173947.26624-12-wsa-dev@sang-engineering.com/","date":"2016-08-25T17:39:03","name":"[11/44] usb: gadget: udc: fsl_qe_udc: don't print on ENOMEM","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"1a965bdfe77ea7a60eeeb3c5a1dd74cbac8762c8","submitter":{"id":69638,"url":"http://patchwork.ozlabs.org/api/people/69638/?format=json","name":"Wolfram Sang","email":"wsa-dev@sang-engineering.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20160825173947.26624-12-wsa-dev@sang-engineering.com/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/662891/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/662891/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3sKsD062dKz9sCj\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 26 Aug 2016 03:50:56 +1000 (AEST)","from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3sKsD04W7CzDrd5\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 26 Aug 2016 03:50:56 +1000 (AEST)","from mail.zeus03.de (www.zeus03.de [194.117.254.33])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3sKs7H4WwmzDrHp\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 26 Aug 2016 03:46:51 +1000 (AEST)","(qmail 6972 invoked from network); 25 Aug 2016 19:40:08 +0200","from dslb-178-008-076-018.178.008.pools.vodafone-ip.de (HELO\n\tlocalhost) (l3s3148p1@178.8.76.18)\n\tby mail.zeus03.de with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted,\n\tauthenticated); 25 Aug 2016 19:40:08 +0200"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=sang-engineering.com header.i=@sang-engineering.com\n\theader.b=0uX7+nui; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=sang-engineering.com header.i=@sang-engineering.com\n\theader.b=0uX7+nui; dkim-atps=neutral","lists.ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sang-engineering.com header.i=@sang-engineering.com\n\theader.b=0uX7+nui; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h=\n\tfrom:to:cc:subject:date:message-id:in-reply-to:references; s=k1;\n\tbh=0c4h3PfsobnNpo0Ygq9eOZHlpnj5+JfooAEsV/fKwqw=; b=0uX7+nuii8U4\n\tHyioyvLUzGsPAKJ9WhZ6N67WASCGI3TJP/lmog2KWkmzfVSNy9bfevcbzpObcHkV\n\tgEre8N53vA4yeW9iUguSJyVEkHdjI6fWVKRpy+RCm8KpVWFbHQp2ghNLLTp1BRVS\n\t+WeFoBcH9F1ch/LBmrVEBkWlYqrL5fA=","From":"Wolfram Sang <wsa-dev@sang-engineering.com>","To":"linux-usb@vger.kernel.org","Subject":"[PATCH 11/44] usb: gadget: udc: fsl_qe_udc: don't print on ENOMEM","Date":"Thu, 25 Aug 2016 19:39:03 +0200","Message-Id":"<20160825173947.26624-12-wsa-dev@sang-engineering.com>","X-Mailer":"git-send-email 2.9.3","In-Reply-To":"<20160825173947.26624-1-wsa-dev@sang-engineering.com>","References":"<20160825173947.26624-1-wsa-dev@sang-engineering.com>","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.22","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"Felipe Balbi <balbi@kernel.org>, linuxppc-dev@lists.ozlabs.org,\n\tWolfram Sang <wsa-dev@sang-engineering.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"},"content":"All kmalloc-based functions print enough information on failures.\n\nSigned-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>\n---\n drivers/usb/gadget/udc/fsl_qe_udc.c | 16 ++++------------\n 1 file changed, 4 insertions(+), 12 deletions(-)","diff":"diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c\nindex cf8819a5c5b263..9d6b2c8eed4294 100644\n--- a/drivers/usb/gadget/udc/fsl_qe_udc.c\n+++ b/drivers/usb/gadget/udc/fsl_qe_udc.c\n@@ -421,10 +421,8 @@ static int qe_ep_rxbd_update(struct qe_ep *ep)\n \tbd = ep->rxbase;\n \n \tep->rxframe = kmalloc(sizeof(*ep->rxframe), GFP_ATOMIC);\n-\tif (ep->rxframe == NULL) {\n-\t\tdev_err(ep->udc->dev, \"malloc rxframe failed\\n\");\n+\tif (!ep->rxframe)\n \t\treturn -ENOMEM;\n-\t}\n \n \tqe_frame_init(ep->rxframe);\n \n@@ -435,9 +433,7 @@ static int qe_ep_rxbd_update(struct qe_ep *ep)\n \n \tsize = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (bdring_len + 1);\n \tep->rxbuffer = kzalloc(size, GFP_ATOMIC);\n-\tif (ep->rxbuffer == NULL) {\n-\t\tdev_err(ep->udc->dev, \"malloc rxbuffer failed,size=%d\\n\",\n-\t\t\t\tsize);\n+\tif (!ep->rxbuffer) {\n \t\tkfree(ep->rxframe);\n \t\treturn -ENOMEM;\n \t}\n@@ -668,10 +664,8 @@ static int qe_ep_init(struct qe_udc *udc,\n \n \tif ((ep->tm == USBP_TM_CTL) || (ep->dir == USB_DIR_IN)) {\n \t\tep->txframe = kmalloc(sizeof(*ep->txframe), GFP_ATOMIC);\n-\t\tif (ep->txframe == NULL) {\n-\t\t\tdev_err(udc->dev, \"malloc txframe failed\\n\");\n+\t\tif (!ep->txframe)\n \t\t\tgoto en_done2;\n-\t\t}\n \t\tqe_frame_init(ep->txframe);\n \t}\n \n@@ -2347,10 +2341,8 @@ static struct qe_udc *qe_udc_config(struct platform_device *ofdev)\n \tu32 offset;\n \n \tudc = kzalloc(sizeof(*udc), GFP_KERNEL);\n-\tif (udc == NULL) {\n-\t\tdev_err(&ofdev->dev, \"malloc udc failed\\n\");\n+\tif (!udc)\n \t\tgoto cleanup;\n-\t}\n \n \tudc->dev = &ofdev->dev;\n \n","prefixes":["11/44"]}