linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: segooon@gmail.com (Kulikov Vasiliy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] usb: lh7a40x_udc: check return value of create_proc_read_entry()
Date: Sat, 31 Jul 2010 21:39:03 +0400	[thread overview]
Message-ID: <1280597943-8485-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/lh7a40x_udc.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index fded3fc..b04a62f 100644
--- a/drivers/usb/gadget/lh7a40x_udc.c
+++ b/drivers/usb/gadget/lh7a40x_udc.c
@@ -244,7 +244,7 @@ udc_proc_read(char *page, char **start, off_t off, int count,
 
 #else	/* !CONFIG_USB_GADGET_DEBUG_FILES */
 
-#define create_proc_files() do {} while (0)
+#define create_proc_files() ({ (void *)1; })
 #define remove_proc_files() do {} while (0)
 
 #endif	/* CONFIG_USB_GADGET_DEBUG_FILES */
@@ -2092,7 +2092,12 @@ static int lh7a40x_udc_probe(struct platform_device *pdev)
 		return -EBUSY;
 	}
 
-	create_proc_files();
+	if (create_proc_files() == NULL) {
+		DEBUG(KERN_ERR "%s: can't get irq %i, err %d\n", driver_name,
+		      IRQ_USBINTR, retval);
+		free_irq(IRQ_USBINTR, dev);
+		return -ENOMEM;
+	}
 
 	return retval;
 }
-- 
1.7.0.4

                 reply	other threads:[~2010-07-31 17:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1280597943-8485-1-git-send-email-segooon@gmail.com \
    --to=segooon@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).