All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/7] usb: omap_udc: check return value of proc_create()
@ 2010-07-31 17:39 ` Kulikov Vasiliy
  0 siblings, 0 replies; 8+ messages in thread
From: Kulikov Vasiliy @ 2010-07-31 17:39 UTC (permalink / raw)
  To: kernel-janitors
  Cc: David Brownell, Greg Kroah-Hartman, Tony Lindgren,
	Cory Maccarrone, linux-usb, linux-kernel

proc_create() may fail, if so return -ENOMEM.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 drivers/usb/gadget/omap_udc.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index f81e4f0..1083216 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2544,9 +2544,9 @@ static const struct file_operations proc_ops = {
 	.release	= single_release,
 };
 
-static void create_proc_file(void)
+static int create_proc_file(void)
 {
-	proc_create(proc_filename, 0, NULL, &proc_ops);
+	return (proc_create(proc_filename, 0, NULL, &proc_ops) == NULL);
 }
 
 static void remove_proc_file(void)
@@ -2556,7 +2556,7 @@ static void remove_proc_file(void)
 
 #else
 
-static inline void create_proc_file(void) {}
+static inline int create_proc_file(void) { return 0; }
 static inline void remove_proc_file(void) {}
 
 #endif
@@ -2998,13 +2998,19 @@ known:
 #endif
 	}
 
-	create_proc_file();
+	if (create_proc_file()) {
+		status = -ENOMEM;
+		goto cleanup3;
+	}
+
 	status = device_add(&udc->gadget.dev);
 	if (!status)
 		return status;
 	/* If fail, fall through */
-#ifdef	USE_ISO
+
+	remove_proc_file();
 cleanup3:
+#ifdef	USE_ISO
 	free_irq(pdev->resource[2].start, udc);
 #endif
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/7] usb: omap_udc: check return value of proc_create()
@ 2010-07-31 17:39 ` Kulikov Vasiliy
  0 siblings, 0 replies; 8+ messages in thread
From: Kulikov Vasiliy @ 2010-07-31 17:39 UTC (permalink / raw)
  To: kernel-janitors
  Cc: David Brownell, Greg Kroah-Hartman, Tony Lindgren,
	Cory Maccarrone, linux-usb, linux-kernel

proc_create() may fail, if so return -ENOMEM.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 drivers/usb/gadget/omap_udc.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index f81e4f0..1083216 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2544,9 +2544,9 @@ static const struct file_operations proc_ops = {
 	.release	= single_release,
 };
 
-static void create_proc_file(void)
+static int create_proc_file(void)
 {
-	proc_create(proc_filename, 0, NULL, &proc_ops);
+	return (proc_create(proc_filename, 0, NULL, &proc_ops) = NULL);
 }
 
 static void remove_proc_file(void)
@@ -2556,7 +2556,7 @@ static void remove_proc_file(void)
 
 #else
 
-static inline void create_proc_file(void) {}
+static inline int create_proc_file(void) { return 0; }
 static inline void remove_proc_file(void) {}
 
 #endif
@@ -2998,13 +2998,19 @@ known:
 #endif
 	}
 
-	create_proc_file();
+	if (create_proc_file()) {
+		status = -ENOMEM;
+		goto cleanup3;
+	}
+
 	status = device_add(&udc->gadget.dev);
 	if (!status)
 		return status;
 	/* If fail, fall through */
-#ifdef	USE_ISO
+
+	remove_proc_file();
 cleanup3:
+#ifdef	USE_ISO
 	free_irq(pdev->resource[2].start, udc);
 #endif
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 5/7] usb: omap_udc: check return value of proc_create()
  2010-07-31 17:39 ` Kulikov Vasiliy
@ 2010-08-01 10:06   ` Sergei Shtylyov
  -1 siblings, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2010-08-01 10:06 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors, David Brownell, Greg Kroah-Hartman,
	Tony Lindgren, Cory Maccarrone, linux-usb, linux-kernel

Hello.

Kulikov Vasiliy wrote:

> proc_create() may fail, if so return -ENOMEM.

> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
[...]
> diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
> index f81e4f0..1083216 100644
> --- a/drivers/usb/gadget/omap_udc.c
> +++ b/drivers/usb/gadget/omap_udc.c
> @@ -2544,9 +2544,9 @@ static const struct file_operations proc_ops = {
>  	.release	= single_release,
>  };
>  
> -static void create_proc_file(void)
> +static int create_proc_file(void)
>  {
> -	proc_create(proc_filename, 0, NULL, &proc_ops);
> +	return (proc_create(proc_filename, 0, NULL, &proc_ops) == NULL);

    Parens not needed around the *return* expression.

WBR, Sergei

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 5/7] usb: omap_udc: check return value of proc_create()
@ 2010-08-01 10:06   ` Sergei Shtylyov
  0 siblings, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2010-08-01 10:06 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors, David Brownell, Greg Kroah-Hartman,
	Tony Lindgren, Cory Maccarrone, linux-usb, linux-kernel

Hello.

Kulikov Vasiliy wrote:

> proc_create() may fail, if so return -ENOMEM.

> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
[...]
> diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
> index f81e4f0..1083216 100644
> --- a/drivers/usb/gadget/omap_udc.c
> +++ b/drivers/usb/gadget/omap_udc.c
> @@ -2544,9 +2544,9 @@ static const struct file_operations proc_ops = {
>  	.release	= single_release,
>  };
>  
> -static void create_proc_file(void)
> +static int create_proc_file(void)
>  {
> -	proc_create(proc_filename, 0, NULL, &proc_ops);
> +	return (proc_create(proc_filename, 0, NULL, &proc_ops) = NULL);

    Parens not needed around the *return* expression.

WBR, Sergei

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Remove me!!!!
  2010-08-01 10:06   ` Sergei Shtylyov
@ 2010-08-01 11:29     ` Yehuda Mor
  -1 siblings, 0 replies; 8+ messages in thread
From: Yehuda Mor @ 2010-08-01 11:29 UTC (permalink / raw)
  To: 'Sergei Shtylyov', 'Kulikov Vasiliy'
  Cc: kernel-janitors, 'David Brownell',
	'Greg Kroah-Hartman', 'Tony Lindgren',
	'Cory Maccarrone',
	linux-usb, linux-kernel


Please, remove my address praxis@actcom.co.il from your lists! I am
receiving unwanted mail from a lot of people around kernel, ubuntu' debian,
etc - and I have no idea why!

Thank you.  







-----Original Message-----
From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Sergei Shtylyov
Sent: Sunday, August 01, 2010 1:07 PM
To: Kulikov Vasiliy
Cc: kernel-janitors@vger.kernel.org; David Brownell; Greg Kroah-Hartman;
Tony Lindgren; Cory Maccarrone; linux-usb@vger.kernel.org;
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/7] usb: omap_udc: check return value of proc_create()

Hello.

Kulikov Vasiliy wrote:

> proc_create() may fail, if so return -ENOMEM.

> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
[...]
> diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
> index f81e4f0..1083216 100644
> --- a/drivers/usb/gadget/omap_udc.c
> +++ b/drivers/usb/gadget/omap_udc.c
> @@ -2544,9 +2544,9 @@ static const struct file_operations proc_ops = {
>  	.release	= single_release,
>  };
>  
> -static void create_proc_file(void)
> +static int create_proc_file(void)
>  {
> -	proc_create(proc_filename, 0, NULL, &proc_ops);
> +	return (proc_create(proc_filename, 0, NULL, &proc_ops) == NULL);

    Parens not needed around the *return* expression.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5329 (20100731) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5329 (20100731) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Remove me!!!!
@ 2010-08-01 11:29     ` Yehuda Mor
  0 siblings, 0 replies; 8+ messages in thread
From: Yehuda Mor @ 2010-08-01 11:29 UTC (permalink / raw)
  To: 'Sergei Shtylyov', 'Kulikov Vasiliy'
  Cc: kernel-janitors, 'David Brownell',
	'Greg Kroah-Hartman', 'Tony Lindgren',
	'Cory Maccarrone',
	linux-usb, linux-kernel


Please, remove my address praxis@actcom.co.il from your lists! I am
receiving unwanted mail from a lot of people around kernel, ubuntu' debian,
etc - and I have no idea why!

Thank you.  







-----Original Message-----
From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Sergei Shtylyov
Sent: Sunday, August 01, 2010 1:07 PM
To: Kulikov Vasiliy
Cc: kernel-janitors@vger.kernel.org; David Brownell; Greg Kroah-Hartman;
Tony Lindgren; Cory Maccarrone; linux-usb@vger.kernel.org;
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/7] usb: omap_udc: check return value of proc_create()

Hello.

Kulikov Vasiliy wrote:

> proc_create() may fail, if so return -ENOMEM.

> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
[...]
> diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
> index f81e4f0..1083216 100644
> --- a/drivers/usb/gadget/omap_udc.c
> +++ b/drivers/usb/gadget/omap_udc.c
> @@ -2544,9 +2544,9 @@ static const struct file_operations proc_ops = {
>  	.release	= single_release,
>  };
>  
> -static void create_proc_file(void)
> +static int create_proc_file(void)
>  {
> -	proc_create(proc_filename, 0, NULL, &proc_ops);
> +	return (proc_create(proc_filename, 0, NULL, &proc_ops) = NULL);

    Parens not needed around the *return* expression.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5329 (20100731) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5329 (20100731) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remove me!!!!
  2010-08-01 11:29     ` Yehuda Mor
  (?)
@ 2010-08-01 12:46     ` Valeo de Vries
  -1 siblings, 0 replies; 8+ messages in thread
From: Valeo de Vries @ 2010-08-01 12:46 UTC (permalink / raw)
  To: Yehuda Mor; +Cc: linux-kernel

No need to spam all those people with this...

On 1 August 2010 12:29, Yehuda Mor <praxis@actcom.co.il> wrote:
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

...as all you need to do is read the above, which is at the bottom of
every e-mail you receive from LKML.

Valeo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remove me!!!!
  2010-08-01 11:29     ` Yehuda Mor
  (?)
  (?)
@ 2010-08-01 15:16     ` trapDoor
  -1 siblings, 0 replies; 8+ messages in thread
From: trapDoor @ 2010-08-01 15:16 UTC (permalink / raw)
  To: Yehuda Mor; +Cc: LKML

On Sun, Aug 1, 2010 at 12:29 PM, Yehuda Mor <praxis@actcom.co.il> wrote:
>
> Please, remove my address praxis@actcom.co.il from your lists! I am
> receiving unwanted mail from a lot of people around kernel, ubuntu' debian,
> etc - and I have no idea why!
>
> Thank you.
>

Hello,
Here is what you need to do:
To unsubscribe from this list [linux-kernel@vger.kernel.org]: send the
line "unsubscribe linux-kernel" in the body of a message to:
majordomo@vger.kernel.org

And similarly, to unsubscribe from e.g linux-usb@vger.kernel.org you
should send e-mail to: majordomo@vger.kernel.org with "unsubscribe
linux-usb" in the body.

Needless to say, you should send the e-mail(s) from the mailbox you
receive unwanted mails on.

----------------------------
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


-- 
Regards
trapDoor

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-08-01 15:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-31 17:39 [PATCH 5/7] usb: omap_udc: check return value of proc_create() Kulikov Vasiliy
2010-07-31 17:39 ` Kulikov Vasiliy
2010-08-01 10:06 ` Sergei Shtylyov
2010-08-01 10:06   ` Sergei Shtylyov
2010-08-01 11:29   ` Remove me!!!! Yehuda Mor
2010-08-01 11:29     ` Yehuda Mor
2010-08-01 12:46     ` Valeo de Vries
2010-08-01 15:16     ` trapDoor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.