From: Kulikov Vasiliy <segooon@gmail.com>
To: kernel-janitors@vger.kernel.org
Cc: David Brownell <dbrownell@users.sourceforge.net>,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
linux-usb@vger.kernel.org,
Anton Vorontsov <avorontsov@ru.mvista.com>,
Dinh Nguyen <Dinh.Nguyen@freescale.com>
Subject: [PATCH 2/7] usb: fsl_udc_core: check return value of create_proc_read_entry()
Date: Sat, 31 Jul 2010 21:38:20 +0400 [thread overview]
Message-ID: <1280597900-8405-1-git-send-email-segooon@gmail.com> (raw)
create_proc_read_entry() may fail, if so return -ENOMEM.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
drivers/usb/gadget/fsl_udc_core.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 08a9a62..c3d1545 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2128,7 +2128,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count,
#else /* !CONFIG_USB_GADGET_DEBUG_FILES */
-#define create_proc_file() do {} while (0)
+#define create_proc_file() ({ (void *)1; })
#define remove_proc_file() do {} while (0)
#endif /* CONFIG_USB_GADGET_DEBUG_FILES */
@@ -2373,9 +2373,14 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
ret = -ENOMEM;
goto err_unregister;
}
- create_proc_file();
+ if (create_proc_file() == 0) {
+ ret = -ENOMEM;
+ goto err_pool;
+ }
return 0;
+err_pool:
+ dma_pool_destroy(udc_controller->td_pool);
err_unregister:
device_unregister(&udc_controller->gadget.dev);
err_free_irq:
--
1.7.0.4
next reply other threads:[~2010-07-31 17:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-31 17:38 Kulikov Vasiliy [this message]
2010-07-31 19:17 ` [PATCH 2/7] usb: fsl_udc_core: check return value of create_proc_read_entry() Dan Carpenter
2010-08-01 6:19 ` Vasiliy Kulikov
2010-08-01 10:49 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1280597900-8405-1-git-send-email-segooon@gmail.com \
--to=segooon@gmail.com \
--cc=Dinh.Nguyen@freescale.com \
--cc=avorontsov@ru.mvista.com \
--cc=dbrownell@users.sourceforge.net \
--cc=gregkh@suse.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).